Flag
A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.Installation
| Install | yarn add @atlaskit/flag |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/flag, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Array of clickable actions to be shown at the bottom of the flag. For flags where appearance is 'normal', actions will be shown as links. For all other appearance values, actions will shown as buttons. If href is passed the action will be shown as a link with the passed href prop. |
|---|---|
| Type | ActionType[] |
| Description | Additional information to be included in the |
|---|---|
| Type | { [x: string]: any; } |
| Description | Makes the flag appearance bold. Setting this to anything other than 'normal' hides the dismiss button. |
|---|---|
| Type | "error" | "info" | "success" | "warning" | "normal" |
| Description | Duration in seconds before flag gets auto dismissed. Default is 8 seconds. For a11y reasons 8s is also a strongly-suggested minimum. Only applies to auto-dismissable flags. |
|---|---|
| Type | number |
| Description | You should not be accessing this prop under any circumstances.
It is provided by |
|---|---|
| Type | (payload: AnalyticsEventPayload) => UIAnalyticsEvent |
| Description | Milliseconds to delay the screen reader announcement due to announcement conflict. |
|---|---|
| Type | number |
| Description | The secondary content shown below the flag title. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | Specifies the heading level in the document structure.
If not specified, the default is |
|---|---|
| Type | 1 | 2 | 3 | 4 | 5 | 6 |
| Description | The icon displayed in the top-left of the flag. Should be an instance of |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | A unique identifier used for rendering and onDismissed callbacks. |
|---|---|
| Type | string | number |
| Description | A link component that is passed down to the |
|---|---|
| Type | React.ComponentClass<CustomThemeButtonProps, any> | React.FunctionComponent<CustomThemeButtonProps> |
| Description | Standard onBlur event, applied to Flag by AutoDismissFlag. |
|---|---|
| Type | (e: React.FocusEvent<HTMLElement, Element>, analyticsEvent: UIAnalyticsEvent) => void |
| Description | Handler which will be called when a Flag's dismiss button is clicked. Receives the id of the dismissed Flag as a parameter. |
|---|---|
| Type | (id: string | number, analyticsEvent: UIAnalyticsEvent) => void |
| Description | Standard onFocus event, applied to Flag by AutoDismissFlag. |
|---|---|
| Type | (e: React.FocusEvent<HTMLElement, Element>, analyticsEvent: UIAnalyticsEvent) => void |
| Description | Standard onMouseOut event, applied to Flag by AutoDismissFlag. |
|---|---|
| Type | (event: React.MouseEvent<Element, MouseEvent>) => void |
| Description | Standard onMouseOver event, applied to Flag by AutoDismissFlag. |
|---|---|
| Type | (event: React.MouseEvent<Element, MouseEvent>) => void |
| Description | No description. |
|---|---|
| Type | ((instance: any) => void) | React.RefObject<any> |
| Description | A Will set these elements when defined:
|
|---|---|
| Type | string |
| Description | The bold text shown at the top of the flag. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |