Buttons
ActiveButton
Storybook
ActiveButton
Storybook
The ActiveButton component in React provides a convenient way to display a button that is destined to be a redirect.
Imports
1import { ActiveButton } from 'dd360-ds'
1import { ActiveButton } from 'dd360-ds/ActiveButton'
1import ActiveButton from 'dd360-ds/ActiveButton'
Usage
Use the properties active and to to make the button active and redirect to the URL specified in the to property.
1import { ActiveButton } from 'dd360-ds'
2
3<ActiveButton
4active
5to={() => alert('Redirecting...')}
6>
7Active Button
8</ActiveButton>
Active
To make the button active, use the property active. When the button is active, it will redirect to the URL specified in the to property. If the to property is not specified, the button will not redirect and the style will be different.
1import { ActiveButton } from 'dd360-ds'
2
3<ActiveButton
4active={false}
5to={() => alert('Redirecting...')}
6>
7Active Button
8</ActiveButton>
API Reference
Name | Types | Default |
---|---|---|
"active" | boolean | true |
"to" | function | - |
"children" | ReactNode | - |
"..." | ButtonHTMLAttributes | - |