Components
Note
A line of information in the flow of a page, with an action beside it when there is something to do.
Your answers save as you go.
The team replies within two working days.
Your application is with the team.
This role closes on Friday.
We couldn't send your answers. Try again.
import { Note } from '@dex/shared/components/note'
export function NoteTones() {
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note>Your answers save as you go.</Note>
<Note tone="info">The team replies within two working days.</Note>
<Note tone="success">Your application is with the team.</Note>
<Note tone="warning">This role closes on Friday.</Note>
<Note tone="danger">We couldn't send your answers. Try again.</Note>
</div>
)
}
Your answers save as you go.
The team replies within two working days.
Your application is with the team.
This role closes on Friday.
We couldn't send your answers. Try again.
import { Note } from '@dex/shared/components/note'
export function NoteFill() {
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note fill>Your answers save as you go.</Note>
<Note fill tone="info">
The team replies within two working days.
</Note>
<Note fill tone="success">
Your application is with the team.
</Note>
<Note fill tone="warning">
This role closes on Friday.
</Note>
<Note fill tone="danger">
We couldn't send your answers. Try again.
</Note>
</div>
)
}
Add a CV to apply in one step.
Dex has recommendations for strengthening your CV
'use client'
import { Button } from '@dex/shared/components/button'
import { Note } from '@dex/shared/components/note'
export function NoteWithAction() {
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note tone="info" action={<Button size="sm">Upload CV</Button>}>
Add a CV to apply in one step.
</Note>
<Note
fill
action={
<>
<Button variant="ghost" size="sm">
Ignore
</Button>
<Button size="sm">Show me</Button>
</>
}
>
Dex has recommendations for strengthening your CV
</Note>
</div>
)
}
Closing soon: applications for this role close on Friday.
import { Note, NoteLabel } from '@dex/shared/components/note'
export function NoteWithLabel() {
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note tone="warning">
<NoteLabel>Closing soon:</NoteLabel> applications for this role close on Friday.
</Note>
</div>
)
}
Dex wrote this summary from your experience.
Your answers save as you go.
import { Sparkles } from 'lucide-react'
import { Note } from '@dex/shared/components/note'
export function NoteIcons() {
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note icon={<Sparkles />}>Dex wrote this summary from your experience.</Note>
<Note icon={null}>Your answers save as you go.</Note>
</div>
)
}
The team replies within two working days.
The team replies within two working days.
3 matches skipped.
'use client'
import { Button } from '@dex/shared/components/button'
import { Note } from '@dex/shared/components/note'
export function NoteSizes() {
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note size="sm" tone="info">
The team replies within two working days.
</Note>
<Note tone="info">The team replies within two working days.</Note>
<Note size="sm" action={<Button size="sm">Undo</Button>}>
3 matches skipped.
</Note>
</div>
)
}
Dex has recommendations for strengthening your CV
Dex has recommendations for strengthening your CV
'use client'
import { useState } from 'react'
import { Button } from '@dex/shared/components/button'
import { Note } from '@dex/shared/components/note'
// Press Submit: each note takes the danger tone, the first filled and the second outlined, as they were.
export function NoteInvalid() {
const [isHeldBack, setIsHeldBack] = useState(false)
return (
<div className="flex w-full max-w-xl flex-col gap-3">
<Note
fill
invalid={isHeldBack}
action={
<Button variant="ghost" size="sm" onClick={() => setIsHeldBack(false)}>
Ignore
</Button>
}
>
Dex has recommendations for strengthening your CV
</Note>
<Note
invalid={isHeldBack}
action={
<Button variant="ghost" size="sm" onClick={() => setIsHeldBack(false)}>
Ignore
</Button>
}
>
Dex has recommendations for strengthening your CV
</Note>
<div className="flex flex-col items-start gap-2">
<Button onClick={() => setIsHeldBack(true)}>Submit</Button>
{isHeldBack && (
<p role="alert" className="text-sm text-destructive">
Check Dex's recommendations for your CV to submit
</p>
)}
</div>
</div>
)
}
- A note is information that sits in the page until the person deals with it or the page changes: a heads-up about a form, or a suggestion with an action beside it. Something that comes and goes on its own is a toast, and a problem with one field is that field's error.
- Two options carry the meaning, as on a badge.
tonesays what it means:neutral,info,success,warningordanger.fillsays how loudly: a hairline edge by default, or a tint of the tone. Never orange: the brand colour is not a status. - Use
fillfor a note inside a card, or one that should read as a block with its action. Use the edge on the page's own background. - Keep a tone for a real status. A suggestion or a fact that is neither good nor bad news is
neutral. - Each tone has its own icon. Replace it with
icononly where another says more, and passicon={null}where the words are enough. - One sentence, two at most, in sentence case.
NoteLabeladds a one or two word prefix in semibold, a step above the note's medium text, such as "Closing soon:". Leave it out when the sentence says it already: never "Note:". actionholds one button atsize="sm", or two: aghostbutton that sets the note aside comes first, and thedefaultbutton that does what it suggests sits on the outside edge, as in a dialog. Set it aside with a word such as Ignore rather than an X.invalidgives the note the danger tone, filled or not as it already was, when it is holding something back, such as a submit, and a message by the button that was held back says what to do, as it would for a field.smin a dense pane, a dialog or a toolbar;defaultbeside body text. Use one size in a group.