Share dialog
The dialog that makes a link to a person's profile and hands it over: who the link is for, whether it names them, a note to go with it, then the link with Copy.
What it shows
Makes a link to a person's profile, and hands it over.
Props
CandidateShareDialog
| Prop | Type | What it does |
|---|---|---|
open (required) | boolean | |
onOpenChange (required) | (open: boolean) => void | Called when the dialog should close: from its close control, Done, or a share that made no link to show. |
candidateName (required) | string | Who is being shared, for the title. |
avatar | ReactNode | Their face beside the title, usually the kit's PersonAvatar at 44px. |
headline | ReactNode | Under the title, such as their title and company. |
reason | ReactNode | The sharer's own reason for putting them forward, under the title. |
audiences | readonly CandidateShareAudience[] | Who the link can be for. With none, the dialog doesn't ask, and onShare gets no audience. |
anonymisable | boolean | Offers the choice between a page that names the person and one that doesn't. |
note | boolean | Offers a typed note for whoever opens the link. |
noteMaxLength | number | The longest note the field takes. |
recorder | ReactNode | A recorder for a spoken note, such as CandidatePresentationRecorder. The host owns the recording and what happens to it. With note as well, the two sit behind a switch, the recorder first, and the one not showing stays mounted, so a take is never lost to the switch. A side shows when its tab is pressed, with a pointer, Enter or Space; the arrow keys move between the two tabs and change nothing. |
defaultNoteFormat | CandidateShareNoteFormat | Which side of that switch shows as the dialog opens: voice (the default), or written for a link that already has a typed note and no recording. It is read as each opening starts; a host that learns the side later holds it as noteFormat. |
noteFormat | CandidateShareNoteFormat | Which side of that switch shows, for a host that holds it, such as one that learns which side a link's note is on only once it has read its links, or as the person sharing changes who the link names. Changing it remounts neither side, so a take in the recorder is kept, and leaves focus where it is. |
onNoteFormatChange | (format: CandidateShareNoteFormat) => void | Called with the side the person sharing asks for, once each time they press the other side's tab, whether or not the host holds the side. |
choices | Partial<CandidateShareChoices> | The choices, for a host that holds them, such as one that fills the note in from a link it already has. Any left out are the dialog's own. |
defaultChoices | Partial<CandidateShareChoices> | Where the dialog's own choices start each time it opens. |
onChoicesChange | (choices: CandidateShareChoices) => void | Called with every choice as it changes. |
url | string | null | The link, where the host already has one for these choices. The dialog shows it with Copy above everything it asks, where it is in view as the dialog opens, and the share button then says labels.update. With no onShare, the dialog is the link and its Copy alone. |
onShare | (choices: CandidateShareChoices) => string | void | PromiseLike<string | void> | Makes the link. It is given the choices and returns the link, or a promise for it; the dialog holds its controls meanwhile and then shows the link with Copy. A promise that resolves with no link closes the dialog, for a host that shows the link somewhere else. One that rejects keeps the dialog as it was, with labels.failed. |
copyOnShare | boolean | Copies the link in the same click that makes it. The clipboard is asked inside that click, for a link that arrives later; a browser that refuses leaves the link with its Copy button. |
waitingFor | ReactNode | What sharing is waiting for, such as a recording that is still uploading ("Finish the voice note to share"). It shows on the share button, which is held until it clears. |
error | ReactNode | An error of the host's own, such as a link that couldn't be read, over the share button. |
labels | Partial<CandidateShareDialogLabels> |
CandidateShareAudience, each of audiences
| Prop | Type | What it does |
|---|---|---|
id (required) | string | Tells the audience from the others, and tells the host which was picked. |
label (required) | string | Its name on the picker, such as "The client". |
description | ReactNode | What that audience sees when they open the link, under the picker. |
fields | ReactNode | Further fields this audience's link needs, such as where they book a call, under the description. The host draws them and holds what is typed in them: the dialog passes none of it to onShare. |
ready | boolean | false holds the share button until the audience's own fields are filled in. |
live | boolean | A link for this audience is already live. Its chip says so. Unless the host also passes that link as url, the dialog says so in place of everything it would ask for that audience, and makes no second one. |
liveDescription | ReactNode | What to say about the live link, in place of labels.live. |
CandidateShareChoices, what onShare is given
| Prop | Type | What it does |
|---|---|---|
audience | string | Who the link is for: the id of one of audiences, or nothing when the dialog offers none. |
anonymised (required) | boolean | The page hides who the person is. Always false unless the dialog is anonymisable. |
note (required) | string | The typed note for whoever opens the link, trimmed, or an empty string. |
Data it needs
The component takes plain values and callbacks and keeps no records of its own. Pass it yours, from the Kith data layer or from a backend you already run.
Copy to your agent
Install RecruiterOS/recruit-ui and add a dialog that shares a candidate's profile by link, named or anonymised, with a note.Presentation recorder
Records a short voice note to send with a person's profile, such as why you recommend them to a client.
Shared profile
A person's profile as whoever it was shared with sees it: who they are, what the sharer says, how well they fit and their career, with a Yes or No and notes from the reader.