Snackbar
This is the <Snackbar />
component. Use the appearance
to change the variants
- Presentation
- Source
This is an info snackbar
This is a warning snackbar
This is an error snackbar
This is a success snackbar
This is a success snackbar
This is a success snackbar
This is a success snackbar
This is a success snackbar
'@candy/kitkat/skeleton'
//Info<Snackbar appearance="info">This is an info snackbar</Snackbar>//Warning<Snackbar appearance="warning">This is a warning snackbar</Snackbar>//Error <Snackbar appearance="error">This is an error snackbar</Snackbar>//Thumbnail Skeleton <Snackbar appearance="success">This is a success snackbar</Snackbar>//Success dismissOnCallback<Snackbar appearance="success" dismissOnCallback>This is a success snackbar</Snackbar>//Success dismissOnCallback with dismissTrigger<Snackbar appearance="success" dismissOnCallback dismissTrigger="Custom Dismiss Trigger">This is a success snackbar</Snackbar>//CustomAction<Snackbar appearance="success" customAction={<Button onClick={() => { console.log('a custom action here')}}>Custom</Button>}> This is a success snackbar</Snackbar>
Basic Usage
import Snackbar from '@candy/kitkat/snackbar'
export const MyComponent = () => (
<Snackbar appearance="generic">This is an alert</Snackbar>
)
Props
Name | Type | Default | Description |
---|---|---|---|
appearance | info / error / success / warning / info | info | Displays color and icon for intent |
children | ReactNode | - | Text Content |
dismissOnCallback | boolean | false | Displays "DISMISS" text and hides Snackbar on DISMISS click |
dismissTrigger | ReactNode | - | A custom trigger for DISMISS may be used |
customAction | ReactNode | - | Customized Buttons and Actions other than DISMISS |