Spoiler
Last updated: 2.0.0 (21/01/2024)
Usage
import { Button, Spoiler, Text } from "@valence-ui/core";
function MyComponent() {
const [show, setShow] = React.useState(hide);
return (
<>
<Button
onClick={() => setShow(!show)}
>
Toggle spoiler
</Button>
<Spoiler
show={show}
>
<Text>
Spoiled content!
</Text>
</Spoiler>
</>
)
}
Props
Extends GenericProps
.
Property
Type
Description
show
boolean
Whether to show or hide the spoiler content. Defaults to true
.
Last updated
Was this helpful?