- Variants
- Composing Content
- Prop Table
import { Alert } from '@duik/it'
import Alert from '@duik/alert'
Alert is a simple component providing an interface for delivering information to user. For a proper usage, you should handle displaying the alert (e.g. in the fixed container) by yourself. Alerts have role="alert" set by default. Maximum width is set to 760px.
rocket This is a default alert | <Alert leftEl={<Icon>rocket</Icon>} rightEl={<button aria-label="Close" className="close" data-dismiss="alert" type="button"><Icon>close</Icon></button>} > This is a default alert </Alert> <div role="alert" class="alert"> <div class="alert-left-el"> <i class="uikon">rocket</i> </div> <div>This is a default alert</div> <div class="alert-right-el"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <i class="uikon">close</i> </button> </div> </div> ReactHTML Snippet |
rocket 983 people started following you. | <Alert leftEl={<Icon>rocket</Icon>} primary rightEl={<button aria-label="Close" className="close" data-dismiss="alert" type="button"><Icon>close</Icon></button>} > 983 people started following you. </Alert> <div role="alert" class="alert alert-primary"> <div class="alert-left-el"> <i class="uikon">rocket</i> </div> <div>983 people started following you.</div> <div class="alert-right-el"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <i class="uikon">close</i> </button> </div> </div> ReactHTML Snippet |
rocket Yey, it's a success! | <Alert leftEl={<Icon>rocket</Icon>} rightEl={<button aria-label="Close" className="close" data-dismiss="alert" type="button"><Icon>close</Icon></button>} success > Yey, it's a success! </Alert> <div role="alert" class="alert alert-success"> <div class="alert-left-el"> <i class="uikon">rocket</i> </div> <div>Yey, it&#x27;s a success!</div> <div class="alert-right-el"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <i class="uikon">close</i> </button> </div> </div> ReactHTML Snippet |
rocket Your dog needs some water! | <Alert danger leftEl={<Icon>rocket</Icon>} rightEl={<button aria-label="Close" className="close" data-dismiss="alert" type="button"><Icon>close</Icon></button>} > Your dog needs some water! </Alert> <div role="alert" class="alert alert-danger"> <div class="alert-left-el"> <i class="uikon">rocket</i> </div> <div>Your dog needs some water!</div> <div class="alert-right-el"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <i class="uikon">close</i> </button> </div> </div> ReactHTML Snippet |
rocket Your coffee might be too hot! | <Alert leftEl={<Icon>rocket</Icon>} rightEl={<button aria-label="Close" className="close" data-dismiss="alert" type="button"><Icon>close</Icon></button>} warning > Your coffee might be too hot! </Alert> <div role="alert" class="alert alert-warning"> <div class="alert-left-el"> <i class="uikon">rocket</i> </div> <div>Your coffee might be too hot!</div> <div class="alert-right-el"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <i class="uikon">close</i> </button> </div> </div> ReactHTML Snippet |
Welcome to Dashboard UI Kit!Super nice kit, easy to compose and build UIs with a beautiful design | <Alert primary rightEl={<button aria-label="Close" className="close" data-dismiss="alert" type="button"><Icon>close</Icon></button>} > <h4> Welcome to Dashboard UI Kit! </h4> <p> Super nice kit, easy to compose and build UIs with a beautiful design </p> <Button sm> Explore Documentation </Button> </Alert> <div role="alert" class="alert alert-primary"> <div> <h4>Welcome to Dashboard UI Kit!</h4> <p>Super nice kit, easy to compose and build UIs with a beautiful design</p> <button class="btn btn-sm" type="button" role="button">Explore Documentation</button> </div> <div class="alert-right-el"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <i class="uikon">close</i> </button> </div> </div> ReactHTML Snippet |
children | Required: false |
type: React.ReactNode | |
className | Required: false |
type: string | |
className, e.g. "my-custom-styling" |
primary | Required: false |
type: boolean | |
Has blue color |
danger | Required: false |
type: boolean | |
Has red color |
success | Required: false |
type: boolean | |
Has green color |
warning | Required: false |
type: boolean | |
Has orange color |
leftEl | Required: false |
type: React.ReactNode | |
Renders node on the left side e.g. some icon |
rightEl | Required: false |
type: React.ReactNode | |
Renders node on the right side, e.g. close button |
...rest | Required: false |
type: any | |
Other properties are passed down to the wrapping element |