The example below loads live from Storybook; open it in Storybook to use the controls.
Default
Section titled “Default”The default tone is info. The title is optional; screen readers hear the tone before it (“Information:”).
Bilgi: A new version is ready
import { InlineAlert } from '@bigbang/ui';
export default function Default() { return ( <InlineAlert title="A new version is ready"> The new version opens when you reload the page. </InlineAlert> );}Each tone has its own background and icon; the border is neutral in every tone. Tone is also given by the icon shape and the spoken prefix, not only by colour.
Bilgi: A new version is ready
Başarılı: Settings saved
Uyarı: Connection is slow
Hata: The form could not be sent
import { InlineAlert } from '@bigbang/ui';
export default function Tones() { return ( <div className="flex flex-col gap-md"> <InlineAlert tone="info" title="A new version is ready"> The new version opens when you reload the page. </InlineAlert> <InlineAlert tone="success" title="Settings saved"> Your changes will also apply next time you sign in. </InlineAlert> <InlineAlert tone="warning" title="Connection is slow"> Changes may save with a delay. </InlineAlert> <InlineAlert tone="danger" title="The form could not be sent"> Fix the marked fields and send it again. </InlineAlert> </div> );}With actions
Section titled “With actions”actions puts up to two small buttons or links under the message.
Hata: The form could not be sent
import { Button, InlineAlert } from '@bigbang/ui';
export default function WithActions() { return ( <InlineAlert tone="danger" title="The form could not be sent" actions={ <> <Button size="sm" variant="secondary"> Try again </Button> <Button size="sm" variant="tertiary"> Details </Button> </> } > Fix the marked fields and send it again. </InlineAlert> );}Dismissible
Section titled “Dismissible”On dismiss the alert fades, is then removed and focus moves to the next control.
Bilgi: A new version is ready
import { InlineAlert } from '@bigbang/ui';
export default function Dismissible() { return ( <InlineAlert dismissible title="A new version is ready"> The new version opens when you reload the page. </InlineAlert> );}Light and dark mode
Section titled “Light and dark mode”The background comes from color-status-*-background, the border from color-border-subtle and the message from color-text-subtle.
Bilgi: A new version is ready
Başarılı: Settings saved
Uyarı: Connection is slow
Hata: The form could not be sent
Bilgi: A new version is ready
Başarılı: Settings saved
Uyarı: Connection is slow
Hata: The form could not be sent
import { InlineAlert } from '@bigbang/ui';
export default function Tones() { return ( <div className="flex flex-col gap-md"> <InlineAlert tone="info" title="A new version is ready"> The new version opens when you reload the page. </InlineAlert> <InlineAlert tone="success" title="Settings saved"> Your changes will also apply next time you sign in. </InlineAlert> <InlineAlert tone="warning" title="Connection is slow"> Changes may save with a delay. </InlineAlert> <InlineAlert tone="danger" title="The form could not be sent"> Fix the marked fields and send it again. </InlineAlert> </div> );}