` element. You can apply modifiers as additional classes.\n\n@css pt-table\n","metadata":{}},"tabs":{"reference":"tabs","route":"core/components/tabs","title":"Tabs","contents":[{"tag":"heading","value":"Tabs","level":1,"route":"core/components/tabs"},"\n
The Tabs
JavaScript API is deprecated since v1.11.0 \n The following
Tabs
React components been deprecated in v1.11.0 favor of the
simpler and more flexible\n Tabs2
API .
Tabs2
will replace
Tabs
in version 2.0. The CSS API has not been changed.\n
\n\n",{"tag":"heading","value":"CSS API","level":2,"route":"core/components/tabs.css-api"},"In addition to the JavaScript API , Blueprint also offers tab styles with the\nclass pt-tabs
. You should add the proper accessibility attributes (role
, aria-selected
, and\naria-hidden
) if you choose to implement tabs with CSS.
\n.pt-tab-panel
elements with aria-hidden="true"
are hidden automatically by the Blueprint CSS.\nYou may also simply omit hidden tabs from your markup to improve performance (the Tabs
\nJavaScript component does this by default).
\n",{"tag":"css","value":"pt-tabs"},{"tag":"heading","value":"Deprecated JavaScript API","level":2,"route":"core/components/tabs.deprecated-javascript-api"},"\n These components are deprecated since v1.11.0. Please use the
Tabs2
API instead.\n
\n\nThe Tabs
, TabList
, Tab
, and TabPanel
components are available in the @blueprintjs/core \npackage. Make sure to review the general usage docs for JS components .
\nFour components are necessary to render tabs: Tabs
, TabList
, Tab
, and TabPanel
.
\nFor performance reasons, only the currently active TabPanel
is rendered into the DOM. When the\nuser switches tabs, data stored in the DOM is lost. This is not an issue in React applications\nbecause of how the library manages the virtual DOM for you.
\n",{"tag":"heading","value":"Sample usage","level":3,"route":"core/components/tabs.sample-usage"},"< Tabs >
< TabList >
< Tab > First tab </ Tab >
< Tab > Second tab </ Tab >
< Tab > Third tab </ Tab >
< Tab isDisabled = { true } > Fourth tab </ Tab >
</ TabList >
< TabPanel >
First panel
</ TabPanel >
< TabPanel >
Second panel
</ TabPanel >
< TabPanel >
Third panel
</ TabPanel >
< TabPanel >
Fourth panel
</ TabPanel >
</ Tabs >
Every component accepts a className
prop that can be used to set additional classes on the\ncomponent's root element. You can get larger tabs by using the pt-large
class on TabList
.
\nYou can use the Tabs
API in controlled or uncontrolled mode. The props you supply will differ\nbetween these approaches.
\n",{"tag":"reactExample","value":"TabsExample"},{"tag":"heading","value":"Tabs props","level":3,"route":"core/components/tabs.tabs-props"},"\n This component is deprecated since v1.11.0. Please use the
Tabs2
API instead.\n
\n\n",{"tag":"interface","value":"ITabsProps"},{"tag":"heading","value":"Tab props","level":3,"route":"core/components/tabs.tab-props"},"\n This component is deprecated since v1.11.0. Please use the
Tabs2
API instead.\n
\n\n",{"tag":"interface","value":"ITabProps"},{"tag":"heading","value":"Usage with React Router","level":3,"route":"core/components/tabs.usage-with-react-router"},"Often, you'll want to link tab navigation to overall app navigation, including updating the URL.\nreact-router is a commonly-used library for React\napplications. Here's how you might configure tabs to work with it:
\nimport { render } from " react-dom " ;
import { Router , Route } from " react-router " ;
import { Tabs , TabList , Tab , TabPanel } from " @blueprintjs/core " ;
const App = ( ) => { ... } ;
const contents = [
< TabList key = { 0 } >
< Tab > Home </ Tab >
< Tab > Projects </ Tab >
</ TabList > ,
< TabPanel key = { 1 } >
home things
</ TabPanel > ,
< TabPanel key = { 2 } >
projects things
</ TabPanel > ,
] ;
export const Home = ( ) => < Tabs selectedTabIndex = { 0 } > { contents } </ Tabs > ;
export const Projects = ( ) => < Tabs selectedTabIndex = { 1 } > { contents } </ Tabs > ;
render (
< Router path = " / " component = { App } >
< Route path = " home " component = { Home } />
< Route path = " projects " component = { Projects } />
</ Router > ,
document . querySelector ( " #app " )
) ;
"],"contentsRaw":"@# Tabs\n\n\n
The `Tabs` JavaScript API is deprecated since v1.11.0 \n The following `Tabs` React components been deprecated in v1.11.0 favor of the [simpler and more flexible\n `Tabs2` API](#core/components/tabs2). `Tabs2` will replace `Tabs` in version 2.0. The CSS API has not been changed.\n\n\n@## CSS API\n\nIn addition to the [JavaScript API](#core/components/tabs2.javascript-api), Blueprint also offers tab styles with the\nclass `pt-tabs`. You should add the proper accessibility attributes (`role`, `aria-selected`, and\n`aria-hidden`) if you choose to implement tabs with CSS.\n\n`.pt-tab-panel` elements with `aria-hidden=\"true\"` are hidden automatically by the Blueprint CSS.\nYou may also simply omit hidden tabs from your markup to improve performance (the `Tabs`\nJavaScript component does this by default).\n\n@css pt-tabs\n\n@## Deprecated JavaScript API\n\n\n These components are deprecated since v1.11.0. Please use the [`Tabs2` API](#core/components/tabs2) instead.\n
\n\nThe `Tabs`, `TabList`, `Tab`, and `TabPanel` components are available in the __@blueprintjs/core__\npackage. Make sure to review the [general usage docs for JS components](#blueprint.usage).\n\nFour components are necessary to render tabs: `Tabs`, `TabList`, `Tab`, and `TabPanel`.\n\nFor performance reasons, only the currently active `TabPanel` is rendered into the DOM. When the\nuser switches tabs, data stored in the DOM is lost. This is not an issue in React applications\nbecause of how the library manages the virtual DOM for you.\n\n@### Sample usage\n\n```tsx\n\n \n First tab \n Second tab \n Third tab \n Fourth tab \n \n \n First panel\n \n \n Second panel\n \n \n Third panel\n \n \n Fourth panel\n \n \n```\n\nEvery component accepts a `className` prop that can be used to set additional classes on the\ncomponent's root element. You can get larger tabs by using the `pt-large` class on `TabList`.\n\nYou can use the `Tabs` API in controlled or uncontrolled mode. The props you supply will differ\nbetween these approaches.\n\n@reactExample TabsExample\n\n@### Tabs props\n\n\n This component is deprecated since v1.11.0. Please use the [`Tabs2` API](#core/components/tabs2) instead.\n
\n\n@interface ITabsProps\n\n@### Tab props\n\n\n This component is deprecated since v1.11.0. Please use the [`Tabs2` API](#core/components/tabs2) instead.\n
\n\n@interface ITabProps\n\n@### Usage with React Router\n\nOften, you'll want to link tab navigation to overall app navigation, including updating the URL.\n[react-router](https://github.com/reactjs/react-router) is a commonly-used library for React\napplications. Here's how you might configure tabs to work with it:\n\n```tsx\nimport { render } from \"react-dom\";\nimport { Router, Route } from \"react-router\";\nimport { Tabs, TabList, Tab, TabPanel } from \"@blueprintjs/core\";\n\nconst App = () => { ... };\n\n// keys are necessary in JSX.Element lists to keep React happy\nconst contents = [\n \n Home \n Projects \n ,\n \n home things\n ,\n \n projects things\n ,\n];\n\n// using SFCs from TS 1.8, but easy to do without them\nexport const Home = () => {contents} ;\nexport const Projects = () => {contents} ;\n\nrender(\n \n \n \n ,\n document.querySelector(\"#app\")\n);\n```\n","metadata":{}},"tabs2":{"reference":"tabs2","route":"core/components/tabs2","title":"Tabs2","contents":[{"tag":"heading","value":"Tabs2","level":1,"route":"core/components/tabs2"},"Tabs allow the user to switch between panels of content.
\n",{"tag":"heading","value":"CSS API","level":2,"route":"core/components/tabs2.css-api"},"In addition to the JavaScript API , Blueprint also offers tab styles with the\nclass pt-tabs
. You should add the proper accessibility attributes (role
, aria-selected
, and\naria-hidden
) if you choose to implement tabs with CSS.
\n.pt-tab-panel
elements with aria-hidden="true"
are hidden automatically by the Blueprint CSS.\nYou may also simply omit hidden tabs from your markup to improve performance (the Tabs
\nJavaScript component does this by default).
\n",{"tag":"css","value":"pt-tabs"},{"tag":"heading","value":"JavaScript API","level":2,"route":"core/components/tabs2.javascript-api"},"\n
Original Tabs
API is deprecated since v1.11.0 \n The original
Tabs
API has been deprecated in v1.11.0 favor of the simpler and more flexible\n
Tabs2
API described below. Documentation for the deprecated components can be found\n
further below .\n This API will replace the deprecated one in v2.0.\n
\n\n\n
Advantages of new API \n
Only two components (Tabs
and Tab
) are needed, rather than the previous four.
\n
Selection is managed by ID, rather than by index. This is more reliable and deterministic and\n does not require translating between numbers and tab names. It does, however, require that\n every Tab
have a locally unique id
prop.
\n
Arbitrary elements are supported in the tab list, and order is respected. Yes, you can even\n insert things between Tab
s.
\n
\n\nThe Tabs2
and Tab2
components are available in the @blueprintjs/core \npackage. Make sure to review the general usage docs for JS components .
\nimport { Tab2 , Tabs2 } from " @blueprintjs/core " ;
< Tabs2 id = " Tabs2Example " onChange = { this . handleTabChange } >
< Tab2 id = " rx " title = " React " panel = { < ReactPanel /> } />
< Tab2 id = " ng " title = " Angular " panel = { < AngularPanel /> } />
< Tab2 id = " mb " title = " Ember " panel = { < EmberPanel /> } />
< Tab2 id = " bb " disabled title = " Backbone " panel = { < BackbonePanel /> } />
< Tabs2.Expander />
< input className = " pt-input " type = " text " placeholder = " Search... " />
</ Tabs2 >
",{"tag":"reactExample","value":"Tabs2Example"},{"tag":"heading","value":"Tabs2","level":3,"route":"core/components/tabs2.tabs2"},"Tabs2
is responsible for rendering the tab list and coordinating selection. It can be used in\ncontrolled mode by providing selectedTabId
and onChange
props, or in uncontrolled mode by\noptionally providing defaultSelectedTabId
and onChange
.
\nChildren of the Tabs2
are rendered in order in the tab list, which is a horizontal flex row.\nTab2
children are managed by the component; clicking one will change selection. Arbitrary other\nchildren are simply rendered; interactions are your responsibility. Insert a <Tabs2.Expander />
\nbetween any two children to right-align all subsequent children (or bottom-align when vertical
).
\n",{"tag":"interface","value":"ITabs2Props"},{"tag":"heading","value":"Tab2","level":3,"route":"core/components/tabs2.tab2"},"Tab2
is a minimal wrapper with no functionality of its own—it is managed entirely by its\nparent Tabs2
wrapper. Tab title text can be set either via title
prop or via React children\n(for more complex content).
\nThe associated tab panel
will be visible when the Tab
is active. Omitting panel
is perfectly\nsafe and allows you to control exactly where the panel appears in the DOM (by rendering it yourself\nas needed).
\n",{"tag":"interface","value":"ITab2Props"}],"contentsRaw":"@# Tabs2\n\nTabs allow the user to switch between panels of content.\n\n@## CSS API\n\nIn addition to the [JavaScript API](#core/components/tabs2.javascript-api), Blueprint also offers tab styles with the\nclass `pt-tabs`. You should add the proper accessibility attributes (`role`, `aria-selected`, and\n`aria-hidden`) if you choose to implement tabs with CSS.\n\n`.pt-tab-panel` elements with `aria-hidden=\"true\"` are hidden automatically by the Blueprint CSS.\nYou may also simply omit hidden tabs from your markup to improve performance (the `Tabs`\nJavaScript component does this by default).\n\n@css pt-tabs\n\n@## JavaScript API\n\n\n
Original `Tabs` API is deprecated since v1.11.0 \n The original `Tabs` API has been deprecated in v1.11.0 favor of the simpler and more flexible\n `Tabs2` API described below. Documentation for the deprecated components can be found\n [further below](#core/components/tabs.deprecated-javascript-api).\n This API will replace the deprecated one in v2.0.\n\n\n\n
Advantages of new API \n
Only two components (`Tabs` and `Tab`) are needed, rather than the previous four.
\n
Selection is managed by ID, rather than by index. This is more reliable and deterministic and\n does not require translating between numbers and tab names. It does, however, require that\n every `Tab` have a locally unique `id` prop.
\n
Arbitrary elements are supported in the tab list, and order is respected. Yes, you can even\n insert things _between_ `Tab`s.
\n
\n\nThe `Tabs2` and `Tab2` components are available in the __@blueprintjs/core__\npackage. Make sure to review the [general usage docs for JS components](#blueprint.usage).\n\n```tsx\nimport { Tab2, Tabs2 } from \"@blueprintjs/core\";\n\n\n } />\n } />\n } />\n } />\n \n \n \n```\n\n@reactExample Tabs2Example\n\n@### Tabs2\n\n`Tabs2` is responsible for rendering the tab list and coordinating selection. It can be used in\ncontrolled mode by providing `selectedTabId` and `onChange` props, or in uncontrolled mode by\noptionally providing `defaultSelectedTabId` and `onChange`.\n\nChildren of the `Tabs2` are rendered in order in the tab list, which is a horizontal flex row.\n`Tab2` children are managed by the component; clicking one will change selection. Arbitrary other\nchildren are simply rendered; interactions are your responsibility. Insert a ` `\nbetween any two children to right-align all subsequent children (or bottom-align when `vertical`).\n\n@interface ITabs2Props\n\n@### Tab2\n\n`Tab2` is a minimal wrapper with no functionality of its own—it is managed entirely by its\nparent `Tabs2` wrapper. Tab title text can be set either via `title` prop or via React children\n(for more complex content).\n\nThe associated tab `panel` will be visible when the `Tab` is active. Omitting `panel` is perfectly\nsafe and allows you to control exactly where the panel appears in the DOM (by rendering it yourself\nas needed).\n\n@interface ITab2Props\n","metadata":{}},"tag":{"reference":"tag","route":"core/components/tag","title":"Tags","contents":[{"tag":"heading","value":"Tags","level":1,"route":"core/components/tag"},"Tags are great for lists of strings.
\n",{"tag":"heading","value":"CSS API","level":2,"route":"core/components/tag.css-api"},"An optional "remove" button can be added inside a tag as a button.pt-tag-remove
. Also add the\nclass .pt-tag-removable
to the .pt-tag
itself to adjust padding. The button is a separate\nelement to support interaction handlers in your framework of choice.
\nA simple .pt-tag
without the remove button can easily function as a badge.
\n",{"tag":"css","value":"pt-tag"},{"tag":"heading","value":"Minimal tags","level":3,"route":"core/components/tag.minimal-tags"},"Add the .pt-minimal
modifier for a lighter tag appearance. The translucent background color\nwill adapt to its container's background color.
\n",{"tag":"css","value":"pt-tag.pt-minimal"},{"tag":"heading","value":"JavaScript API","level":2,"route":"core/components/tag.javascript-api"},"The Tag
component is available in the @blueprintjs/core package.\nMake sure to review the general usage docs for JS components .
\nTag components render .pt-tag
elements with optional close buttons. Provide tag content as children
.
\nYou can provide your own props to these components as if they were regular JSX HTML elements. If\nyou provide a className
prop, the class names you provide will be added alongside of the default\nBlueprint class name.
\n< Tag intent = { Intent . PRIMARY } onRemove = { this . deleteTag } > Done </ Tag >
< span class = " pt-tag pt-intent-primary pt-tag-removable " >
Done
< button class = " pt-tag-remove " onClick = { this . deleteTag } > </ button >
</ span >
",{"tag":"interface","value":"ITagProps"},{"tag":"reactExample","value":"TagExample"}],"contentsRaw":"@# Tags\n\nTags are great for lists of strings.\n\n@## CSS API\n\nAn optional \"remove\" button can be added inside a tag as a `button.pt-tag-remove`. Also add the\nclass `.pt-tag-removable` to the `.pt-tag` itself to adjust padding. The button is a separate\nelement to support interaction handlers in your framework of choice.\n\nA simple `.pt-tag` without the remove button can easily function as a badge.\n\n@css pt-tag\n\n@### Minimal tags\n\nAdd the `.pt-minimal` modifier for a lighter tag appearance. The translucent background color\nwill adapt to its container's background color.\n\n@css pt-tag.pt-minimal\n\n@## JavaScript API\n\nThe `Tag` component is available in the __@blueprintjs/core__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\nTag components render `.pt-tag` elements with optional close buttons. Provide tag content as `children`.\n\nYou can provide your own props to these components as if they were regular JSX HTML elements. If\nyou provide a `className` prop, the class names you provide will be added alongside of the default\nBlueprint class name.\n\n```tsx\nDone \n// renders:\n\n Done\n \n \n```\n\n@interface ITagProps\n\n@reactExample TagExample\n","metadata":{}},"text":{"reference":"text","route":"core/components/text","title":"Text","contents":[{"tag":"heading","value":"Text","level":1,"route":"core/components/text"},"The Text
component adds accessible overflow behavior to a line of text by\nconditionally adding the title attribute and truncating with an ellipsis when content overflows its container.
\n",{"tag":"heading","value":"JavaScript API","level":2,"route":"core/components/text.javascript-api"},"The Text
component is available in the @blueprintjs/core package.\nMake sure to review the general usage docs for JS components .
\nText
accepts and renders arbitrary children. It is intended that these children render as text.
\n",{"tag":"interface","value":"ITextProps"},{"tag":"reactExample","value":"TextExample"}],"contentsRaw":"@# Text\n\nThe `Text` component adds accessible overflow behavior to a line of text by\nconditionally adding the title attribute and truncating with an ellipsis when content overflows its container.\n\n@## JavaScript API\n\nThe `Text` component is available in the __@blueprintjs/core__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n`Text` accepts and renders arbitrary children. It is intended that these children render as text.\n\n@interface ITextProps\n\n@reactExample TextExample\n","metadata":{}},"toast":{"reference":"toast","route":"core/components/toast","title":"Toasts","contents":[{"tag":"heading","value":"Toasts","level":1,"route":"core/components/toast"},"A toast is a lightweight, ephemeral notice from an application in direct response to a user's action.
\nToast
s have a built-in timeout of five seconds. Users can also dismiss them manually by clicking the × button.\nHovering the cursor over a toast prevents it from disappearing. When the cursor leaves the toast, the toast's timeout restarts.\nSimilarly, focusing the toast (for example, by hitting the tab
key) halts the timeout, and blurring restarts the timeout.
\nYou can add one additional action button to a toast. You might use this to undo the user's action, for example.
\nYou can also apply the same visual intent styles to Toast
s that you can to Button
s .
\nToasts can be configured to appear at either the top or the bottom of an application window, and it is possible to\nhave more than one toast onscreen at a time.
\n",{"tag":"reactExample","value":"ToastExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"core/components/toast.javascript-api"},"The Toast
and Toaster
components are available in the @blueprintjs/core package.\nMake sure to review the general usage docs for JS components .
\nThe Toaster
component provides the static create
method that returns a new Toaster
instance, rendered into an\nelement attached to <body>
. (You can also specify the element to render into if desired.) A Toaster
instance\nhas a collection of methods to show and hide toasts in its given container.
\nYour application can contain several Toaster
instances and easily share them across the codebase as modules.
\n
import { Position , Toaster } from " @blueprintjs/core " ;
export const OurToaster = Toaster . create ( {
className : " my-toaster " ,
position : Position . BOTTOM_RIGHT ,
} ) ;
import { OurToaster } from " ./toaster " ;
const key = OurToaster . show ( { message : " Toasted! " } ) ;
OurToaster . update ( key , { message : " Still toasted! " } ) ;
\n
Working with multiple toasters \n You can have multiple toasters in a single application, but you must ensure that each has a unique\n position
to prevent overlap.\n\n\n\n
Toaster focus \n Toaster
always disables Overlay
's enforceFocus
behavior (meaning that you're not blocked\n from accessing other parts of the application while a toast is active), and by default also\n disables autoFocus
(meaning that focus will not switch to a toast when it appears). You can\n enable autoFocus
for a Toaster
via a prop, if desired.\n\n\n",{"tag":"heading","value":"Static method","level":3,"route":"core/components/toast.static-method"},"Toaster . create ( props ? : IToasterProps , container = document . body ) : IToaster
Create a new Toaster
instance. The Toaster
will be rendered into a new element appended to the\ngiven container
. The container
determines which element toasts are positioned relative to; the\ndefault value of <body>
allows them to use the entire viewport.
\nNote that the return type is IToaster
, which is a minimal interface that exposes only the instance\nmethods detailed below. It can be thought of as Toaster
minus the React.Component
methods,\nbecause the Toaster
should not be treated as a normal React component.
\n",{"tag":"interface","value":"IToasterProps"},{"tag":"heading","value":"Instance methods","level":3,"route":"core/components/toast.instance-methods"},"IToaster
\n\n\nshow(props: IToastProps): string
— Show a new toast to the user.\nReturns the unique key of the new toast. \nupdate(key: string, props: IToastProps): void
—\nUpdates the toast with the given key to use the new props.\nUpdating a key that does not exist is effectively a no-op. \ndismiss(key: string): void
— Dismiss the given toast instantly. \nclear(): void
— Dismiss all toasts instantly. \ngetToasts(): IToastProps[]
— Returns the options for all current toasts. \n \n",{"tag":"interface","value":"IToastProps"},{"tag":"heading","value":"React component","level":3,"route":"core/components/toast.react-component"},"The Toaster
React component is a stateful container for a single list of toasts. Internally, it\nuses Overlay
to manage children and transitions. It can be vertically\naligned along the top or bottom edge of its container (new toasts will slide in from that edge) and\nhorizontally aligned along the left edge, center, or right edge of its container.
\nYou should use Toaster.create
, rather than using the\nToaster
component API directly in React, to avoid having to use ref
to access the instance.
\nimport { Button , Position , Toaster } from " @blueprintjs/core " ;
class MyComponent extends React . Component < { } , { } > {
private toaster : Toaster ;
private refHandlers = {
toaster : ( ref : Toaster ) => this . toaster = ref ,
} ;
public render ( ) {
return (
< div >
< Button onClick = { this . addToast } text = " Procure toast " />
< Toaster position = { Position . TOP_RIGHT } ref = { this . refHandlers . toaster } />
</ div >
)
}
private addToast = ( ) => {
this . toaster . show ( { message : " Toasted! " } ) ;
}
}
"],"contentsRaw":"@# Toasts\n\nA toast is a lightweight, ephemeral notice from an application in direct response to a user's action.\n\n`Toast`s have a built-in timeout of five seconds. Users can also dismiss them manually by clicking the × button.\nHovering the cursor over a toast prevents it from disappearing. When the cursor leaves the toast, the toast's timeout restarts.\nSimilarly, focusing the toast (for example, by hitting the `tab` key) halts the timeout, and blurring restarts the timeout.\n\nYou can add one additional action button to a toast. You might use this to undo the user's action, for example.\n\nYou can also apply the same visual intent styles to `Toast`s that you can to [`Button`s](#core/components/button.css-api).\n\nToasts can be configured to appear at either the top or the bottom of an application window, and it is possible to\nhave more than one toast onscreen at a time.\n\n@reactExample ToastExample\n\n@## JavaScript API\n\nThe `Toast` and `Toaster` components are available in the __@blueprintjs/core__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\nThe `Toaster` component provides the static `create` method that returns a new `Toaster` instance, rendered into an\nelement attached to ``. (You can also specify the element to render into if desired.) A `Toaster` instance\nhas a collection of methods to show and hide toasts in its given container.\n\nYour application can contain several `Toaster` instances and easily share them across the codebase as modules.\n\n```tsx\n// toaster.ts\nimport { Position, Toaster } from \"@blueprintjs/core\";\n\nexport const OurToaster = Toaster.create({\n className: \"my-toaster\",\n position: Position.BOTTOM_RIGHT,\n});\n```\n\n```tsx\n// application.ts\nimport { OurToaster } from \"./toaster\";\n\nconst key = OurToaster.show({ message: \"Toasted!\" });\nOurToaster.update(key, { message: \"Still toasted!\" });\n```\n\n\n
Working with multiple toasters \n You can have multiple toasters in a single application, but you must ensure that each has a unique\n `position` to prevent overlap.\n\n\n\n
Toaster focus \n `Toaster` always disables `Overlay`'s `enforceFocus` behavior (meaning that you're not blocked\n from accessing other parts of the application while a toast is active), and by default also\n disables `autoFocus` (meaning that focus will not switch to a toast when it appears). You can\n enable `autoFocus` for a `Toaster` via a prop, if desired.\n\n\n@### Static method\n\n```ts\nToaster.create(props?: IToasterProps, container = document.body): IToaster\n```\n\nCreate a new `Toaster` instance. The `Toaster` will be rendered into a new element appended to the\ngiven `container`. The `container` determines which element toasts are positioned relative to; the\ndefault value of `` allows them to use the entire viewport.\n\nNote that the return type is `IToaster`, which is a minimal interface that exposes only the instance\nmethods detailed below. It can be thought of as `Toaster` minus the `React.Component` methods,\nbecause the `Toaster` should not be treated as a normal React component.\n\n@interface IToasterProps\n\n@### Instance methods\n\nIToaster
\n\n- `show(props: IToastProps): string` — Show a new toast to the user.\nReturns the unique key of the new toast.\n- `update(key: string, props: IToastProps): void` —\nUpdates the toast with the given key to use the new props.\nUpdating a key that does not exist is effectively a no-op.\n- `dismiss(key: string): void` — Dismiss the given toast instantly.\n- `clear(): void` — Dismiss all toasts instantly.\n- `getToasts(): IToastProps[]` — Returns the options for all current toasts.\n\n@interface IToastProps\n\n@### React component\n\nThe `Toaster` React component is a stateful container for a single list of toasts. Internally, it\nuses [`Overlay`](#core/components/overlay) to manage children and transitions. It can be vertically\naligned along the top or bottom edge of its container (new toasts will slide in from that edge) and\nhorizontally aligned along the left edge, center, or right edge of its container.\n\nYou should use [`Toaster.create`](#core/components/toast.static-method), rather than using the\n`Toaster` component API directly in React, to avoid having to use `ref` to access the instance.\n\n```tsx\nimport { Button, Position, Toaster } from \"@blueprintjs/core\";\n\nclass MyComponent extends React.Component<{}, {}> {\n private toaster: Toaster;\n private refHandlers = {\n toaster: (ref: Toaster) => this.toaster = ref,\n };\n\n public render() {\n return (\n \n \n \n
\n )\n }\n\n private addToast = () => {\n this.toaster.show({ message: \"Toasted!\" });\n }\n}\n```\n","metadata":{}},"tooltip":{"reference":"tooltip","route":"core/components/tooltip","title":"Tooltips","contents":[{"tag":"heading","value":"Tooltips","level":1,"route":"core/components/tooltip"},"\n
\n
Tooltip2
, the next iteration of this component, is available in the
labs package,\n and uses a new positioning engine called Popper.js to provide much more reliable smart positioning.\n
\n\nTooltips display a small string of text next to a target element.
\n",{"tag":"reactExample","value":"TooltipExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"core/components/tooltip.javascript-api"},"The Tooltip
component is available in the @blueprintjs/core package.\nMake sure to review the general usage docs for JS components .
\nWhen creating a tooltip, you must specify both:
\n\nits content , by setting the content
prop, and \nits target , as a single child element or as plain text \n \nWhen the user hovers over the target, the content is displayed in a tooltip above the target.
\nContent can be a string
or a single JSX.Element
(typically used to format said string),\nbut you should keep it simple. If you need more space, consider using a popover instead of a tooltip.
\n\n
Button targets \n Buttons make great tooltip targets, but the
disabled
attribute will prevent all events so the enclosing
Tooltip
\n will not know when to respond. Use
AnchorButton
instead;\n see the
callout here for more details.\n
\n\n",{"tag":"interface","value":"ITooltipProps"},{"tag":"heading","value":"Controlled mode","level":3,"route":"core/components/tooltip.controlled-mode"},"The Tooltip
component supports controlled mode in exactly the same way the Popover
component\ndoes. Please refer to the controlled mode documentation for\nPopover
for details.
\n",{"tag":"heading","value":"Inline tooltips","level":3,"route":"core/components/tooltip.inline-tooltips"},"Inline tooltips (with inline={true}
) do not have a set width, and therefore will not break long\ncontent into multiple lines. This is enforced with white-space: nowrap
.
\nIf you want to create an inline tooltip with content spanning multiple lines, you must override the\ndefault styles and set an appropriate size for .pt-tooltip
.
\n",{"tag":"heading","value":"Combining with popover","level":3,"route":"core/components/tooltip.combining-with-popover"},"You can give a single target both a popover and a tooltip. You must put the Tooltip
inside the\nPopover
(and the target inside the Tooltip
).
\nThis order is required because when the popover is open, the tooltip is disabled, to prevent both\nelements from appearing at the same time.
\n< Popover content = { < h1 > Popover! </ h1 > } position = { Position . RIGHT } >
< Tooltip content = " I has a popover! " position = { Position . RIGHT } >
< button className = " pt-button pt-intent-success " > Hover and click me </ button >
</ Tooltip >
</ Popover >
",{"tag":"heading","value":"SVG tooltip","level":3,"route":"core/components/tooltip.svg-tooltip"},"SVGTooltip
is a convenience component provided for SVG contexts. It is a simple wrapper around\nTooltip
that sets rootElementTag="g"
.
\n",{"tag":"heading","value":"Dark theme","level":3,"route":"core/components/tooltip.dark-theme"},"If the trigger for a tooltip is nested inside a .pt-dark
container, the tooltip will\nautomatically have the dark theme applied as well.
\nYou can also explicitly apply the dark theme to a tooltip by adding the prop\ntooltipClassName="pt-dark"
.
\n"],"contentsRaw":"@# Tooltips\n\n\n
[Tooltip2 available in labs package](#labs.tooltip2) \n [`Tooltip2`](#labs.tooltip2), the next iteration of this component, is available in the __labs__ package,\n and uses a new positioning engine called Popper.js to provide much more reliable smart positioning.\n\n\nTooltips display a small string of text next to a target element.\n\n@reactExample TooltipExample\n\n@## JavaScript API\n\nThe `Tooltip` component is available in the __@blueprintjs/core__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\nWhen creating a tooltip, you must specify both:\n- its _content_, by setting the `content` prop, and\n- its _target_, as a single child element or as plain text\n\nWhen the user hovers over the target, the content is displayed in a tooltip above the target.\n\nContent can be a `string` or a single `JSX.Element` (typically used to format said string),\nbut you should keep it simple. If you need more space, consider using a popover instead of a tooltip.\n\n\n
Button targets \n Buttons make great tooltip targets, but the `disabled` attribute will prevent all events so the enclosing `Tooltip`\n will not know when to respond. Use [`AnchorButton`](#ore/components/button.anchor-button) instead;\n see the [callout here](#core/components/button.javascript-api) for more details.\n\n\n@interface ITooltipProps\n\n@### Controlled mode\n\nThe `Tooltip` component supports controlled mode in exactly the same way the `Popover` component\ndoes. Please refer to the [controlled mode documentation](#core/components/popover.controlled-mode) for\n`Popover` for details.\n\n@### Inline tooltips\n\nInline tooltips (with `inline={true}`) do not have a set width, and therefore will not break long\ncontent into multiple lines. This is enforced with `white-space: nowrap`.\n\nIf you want to create an inline tooltip with content spanning multiple lines, you must override the\ndefault styles and set an appropriate size for `.pt-tooltip`.\n\n@### Combining with popover\n\nYou can give a single target both a popover and a tooltip. You must put the `Tooltip` inside the\n`Popover` (and the target inside the `Tooltip`).\n\nThis order is required because when the popover is open, the tooltip is disabled, to prevent both\nelements from appearing at the same time.\n\n```tsx\nPopover!} position={Position.RIGHT}>\n \n Hover and click me \n \n \n```\n\n@### SVG tooltip\n\n`SVGTooltip` is a convenience component provided for SVG contexts. It is a simple wrapper around\n`Tooltip` that sets `rootElementTag=\"g\"`.\n\n@### Dark theme\n\nIf the trigger for a tooltip is nested inside a `.pt-dark` container, the tooltip will\nautomatically have the dark theme applied as well.\n\nYou can also explicitly apply the dark theme to a tooltip by adding the prop\n`tooltipClassName=\"pt-dark\"`.\n","metadata":{}},"tree":{"reference":"tree","route":"core/components/tree","title":"Trees","contents":[{"tag":"heading","value":"Trees","level":1,"route":"core/components/tree"},"Trees display hierarchical data.
\n",{"tag":"heading","value":"CSS API","level":2,"route":"core/components/tree.css-api"},"See below for the JavaScript API for the Tree
React component. However, you\nmay also use the provided styles by themselves, without using the component.
\n\n Note that the following examples set a maximum width and background color for the tree;\n you may want to do this as well in your own usage.\n
\n\n",{"tag":"css","value":"pt-tree"},{"tag":"heading","value":"JavaScript API","level":2,"route":"core/components/tree.javascript-api"},"The Tree
component is available in the @blueprintjs/core package.\nMake sure to review the general usage docs for JS components .
\nTree
is a stateless component. Its contents are dictated by the contents
prop, which is an array\nof ITreeNode
s (see below ). The tree is multi-rooted if contents
\ncontains more than one top-level object.
\nA variety of interaction callbacks are also exposed as props. All interaction callbacks supply a\nparameter nodePath
, which is an array of numbers representing a node's position in the tree. For\nexample, [2, 0]
represents the first child (0
) of the third top-level node (2
).
\n",{"tag":"interface","value":"ITreeProps"},{"tag":"reactExample","value":"TreeExample"},{"tag":"heading","value":"Instance methods","level":3,"route":"core/components/tree.instance-methods"},"Tree
\n\n\ngetNodeContentElement(nodeId: string | number): HTMLElement | undefined
–\n Returns the underlying HTML element of the Tree
node with an id of nodeId
.\n This element does not contain the children of the node, only its label and controls.\n If the node is not currently mounted, undefined
is returned. \n \n",{"tag":"heading","value":"Tree node interface","level":3,"route":"core/components/tree.tree-node-interface"},"ITreeNode
objects determine the contents, appearance, and state of each node in the tree.
\nFor example, iconName
controls the icon displayed for the node, and isExpanded
determines\nwhether the node's children are shown.
\n",{"tag":"interface","value":"ITreeNodeProps"}],"contentsRaw":"@# Trees\n\nTrees display hierarchical data.\n\n@## CSS API\n\nSee below for the [JavaScript API](#core/components/tree.javascript-api) for the `Tree` React component. However, you\nmay also use the provided styles by themselves, without using the component.\n\n\n Note that the following examples set a maximum width and background color for the tree;\n you may want to do this as well in your own usage.\n
\n\n@css pt-tree\n\n@## JavaScript API\n\nThe `Tree` component is available in the __@blueprintjs/core__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n`Tree` is a stateless component. Its contents are dictated by the `contents` prop, which is an array\nof `ITreeNode`s (see [below](#components/tree.tree-node-interface)). The tree is multi-rooted if `contents`\ncontains more than one top-level object.\n\nA variety of interaction callbacks are also exposed as props. All interaction callbacks supply a\nparameter `nodePath`, which is an array of numbers representing a node's position in the tree. For\nexample, `[2, 0]` represents the first child (`0`) of the third top-level node (`2`).\n\n@interface ITreeProps\n\n@reactExample TreeExample\n\n@### Instance methods\n\nTree
\n\n- `getNodeContentElement(nodeId: string | number): HTMLElement | undefined` –\n Returns the underlying HTML element of the `Tree` node with an id of `nodeId`.\n This element does not contain the children of the node, only its label and controls.\n If the node is not currently mounted, `undefined` is returned.\n\n@### Tree node interface\n\n`ITreeNode` objects determine the contents, appearance, and state of each node in the tree.\n\nFor example, `iconName` controls the icon displayed for the node, and `isExpanded` determines\nwhether the node's children are shown.\n\n@interface ITreeNodeProps\n\n","metadata":{}},"accessibility":{"reference":"accessibility","route":"core/accessibility","title":"Accessibility","contents":[{"tag":"heading","value":"Accessibility","level":1,"route":"core/accessibility"},"Blueprint strives to provide accessible components out of the box. Many of the JS components\nwill apply accessible HTML attributes to support different modes of usage.
\n",{"tag":"heading","value":"Focus management","level":2,"route":"core/accessibility.focus-management"},"Focus states (that glowy blue outline around the active element) are essential for keyboard\nnavigation to indicate which element is currently active. They are less important, and\noccasionally outright intrusive, when using a mouse because you can click wherever you want at\nany time.
\nBlueprint includes a utility that manages the appearance of focus styles. When enabled, focus styles\nwill be hidden while the user interacts using the mouse and will appear when the\ntab key is pressed to begin keyboard navigation. Try this out for yourself\nbelow.
\nYou must explictly enable this feature in your app (and you probably want to):
\nimport { FocusStyleManager } from " @blueprintjs/core " ;
FocusStyleManager . onlyShowFocusOnTabs ( ) ;
Note that the focus style for text inputs (a slightly thicker colored border) is not removed by this\nutility because it is always useful to know where you're typing.
\n",{"tag":"reactExample","value":"FocusExample"},{"tag":"heading","value":"JavaScript API","level":3,"route":"core/accessibility.javascript-api"},"This behavior is controlled by a singleton instance called FocusStyleManager
that lives in the\n@blueprintjs/core package. It supports the following public methods:
\n\nFocusStyleManager.isActive(): boolean
: Returns whether the FocusStyleManager
is currently running. \nFocusStyleManager.onlyShowFocusOnTabs(): void
: Enable behavior which hides focus styles during mouse interaction. \nFocusStyleManager.alwaysShowFocus(): void
: Stop this behavior (focus styles are always visible). \n \n",{"tag":"heading","value":"Color contrast","level":2,"route":"core/accessibility.color-contrast"},"Colors have been designed to be accessible to as many people as possible, even those who are\nvisually impaired or experiencing any kind of colorblindness. Our colors have not only been chosen\nto go well together but to also adhere to WCAG 2.0 standards.
\n"],"contentsRaw":"@# Accessibility\n\nBlueprint strives to provide accessible components out of the box. Many of the JS components\nwill apply accessible HTML attributes to support different modes of usage.\n\n@## Focus management\n\nFocus states (that glowy blue outline around the active element) are essential for keyboard\nnavigation to indicate which element is currently active. They are less important, and\noccasionally outright intrusive, when using a mouse because you can click wherever you want at\nany time.\n\nBlueprint includes a utility that manages the appearance of focus styles. When enabled, focus styles\nwill be hidden while the user interacts using the mouse and will appear when the\ntab key is pressed to begin keyboard navigation. Try this out for yourself\nbelow.\n\n**You must explictly enable this feature in your app (and you probably want to):**\n\n```ts\nimport { FocusStyleManager } from \"@blueprintjs/core\";\n\nFocusStyleManager.onlyShowFocusOnTabs();\n```\n\nNote that the focus style for text inputs (a slightly thicker colored border) is not removed by this\nutility because it is always useful to know where you're typing.\n\n@reactExample FocusExample\n\n@### JavaScript API\n\nThis behavior is controlled by a singleton instance called `FocusStyleManager` that lives in the\n__@blueprintjs/core__ package. It supports the following public methods:\n\n- `FocusStyleManager.isActive(): boolean`: Returns whether the `FocusStyleManager` is currently running.\n- `FocusStyleManager.onlyShowFocusOnTabs(): void`: Enable behavior which hides focus styles during mouse interaction.\n- `FocusStyleManager.alwaysShowFocus(): void`: Stop this behavior (focus styles are always visible).\n\n@## Color contrast\n\nColors have been designed to be accessible to as many people as possible, even those who are\nvisually impaired or experiencing any kind of colorblindness. Our colors have not only been chosen\nto go well together but to also adhere to [WCAG 2.0](https://www.w3.org/TR/WCAG20/) standards.\n","metadata":{}},"color-aliases":{"reference":"color-aliases","route":"color-aliases","title":"Color aliases","contents":[{"tag":"heading","value":"Color aliases","level":2,"route":"core/colors.color-aliases"},"These variables are semantic aliases of our colors .\nThey are used throughout Blueprint itself to ensure consistent color usage across components.
\n\n \n \n \n Variable \n Description \n \n \n \n \n \n
\n \n $pt-intent-primary
\n Primary intent color \n \n \n \n
\n \n $pt-intent-success
\n Success intent color \n \n \n \n
\n \n $pt-intent-warning
\n Warning intent color \n \n \n \n
\n \n $pt-intent-danger
\n Danger intent color \n \n \n \n \n
\n \n $pt-app-background-color
\n Application background color \n \n \n \n
\n \n $pt-dark-app-background-color
\n Dark theme application background color \n \n \n \n \n
\n \n $pt-text-color
\n Default text color \n \n \n \n
\n \n $pt-text-color-muted
\n Muted text color \n \n \n \n
\n \n $pt-text-color-disabled
\n Disabled text color \n \n \n \n
\n \n $pt-heading-color
\n Text color for headers \n \n \n \n
\n \n $pt-link-color
\n Text color for links \n \n \n \n
\n \n $pt-dark-text-color
\n Dark theme default text color \n \n \n \n
\n \n $pt-dark-text-color-muted
\n Dark theme muted text color \n \n \n \n
\n \n $pt-dark-text-color-disabled
\n Dark theme disabled text color \n \n \n \n
\n \n $pt-dark-heading-color
\n Dark theme text color for headers \n \n \n \n
\n \n $pt-dark-link-color
\n Dark theme text color for links \n \n \n \n
\n \n $pt-text-selection-color
\n Text selection color \n \n \n \n \n
\n \n $pt-icon-color
\n Default icon color \n \n \n \n
\n \n $pt-icon-color-hover
\n Hovered icon color \n \n \n \n
\n \n $pt-icon-color-disabled
\n Disabled icon color \n \n \n \n
\n \n $pt-icon-color-selected
\n Selected icon color \n \n \n \n
\n \n $pt-dark-icon-color
\n Dark theme default icon color \n \n \n \n
\n \n $pt-dark-icon-color-hover
\n Dark theme hovered icon color \n \n \n \n
\n \n $pt-dark-icon-color-disabled
\n Dark theme disabled icon color \n \n \n \n
\n \n $pt-dark-icon-color-selected
\n Dark theme selected icon color \n \n \n \n \n
\n \n $pt-divider-black
\n Black divider color \n \n \n \n
\n \n $pt-dark-divider-black
\n Dark theme black divider color \n \n \n \n
\n \n $pt-dark-divider-white
\n Dark theme white divider color \n \n \n \n \n
\n \n $pt-code-text-color
\n Code text color \n \n \n \n
\n \n $pt-code-background-color
\n Code background color \n \n \n \n
\n \n $pt-dark-code-text-color
\n Dark theme code text color \n \n \n \n
\n \n $pt-dark-code-background-color
\n Dark theme code background color \n \n \n
\n"],"contentsRaw":"@## Color aliases\n\nThese variables are semantic aliases of our [colors](#colors).\nThey are used throughout Blueprint itself to ensure consistent color usage across components.\n\n\n \n \n \n Variable \n Description \n \n \n \n \n \n
\n \n $pt-intent-primary
\n Primary intent color \n \n \n \n
\n \n $pt-intent-success
\n Success intent color \n \n \n \n
\n \n $pt-intent-warning
\n Warning intent color \n \n \n \n
\n \n $pt-intent-danger
\n Danger intent color \n \n \n \n \n
\n \n $pt-app-background-color
\n Application background color \n \n \n \n
\n \n $pt-dark-app-background-color
\n Dark theme application background color \n \n \n \n \n
\n \n $pt-text-color
\n Default text color \n \n \n \n
\n \n $pt-text-color-muted
\n Muted text color \n \n \n \n
\n \n $pt-text-color-disabled
\n Disabled text color \n \n \n \n
\n \n $pt-heading-color
\n Text color for headers \n \n \n \n
\n \n $pt-link-color
\n Text color for links \n \n \n \n
\n \n $pt-dark-text-color
\n Dark theme default text color \n \n \n \n
\n \n $pt-dark-text-color-muted
\n Dark theme muted text color \n \n \n \n
\n \n $pt-dark-text-color-disabled
\n Dark theme disabled text color \n \n \n \n
\n \n $pt-dark-heading-color
\n Dark theme text color for headers \n \n \n \n
\n \n $pt-dark-link-color
\n Dark theme text color for links \n \n \n \n
\n \n $pt-text-selection-color
\n Text selection color \n \n \n \n \n
\n \n $pt-icon-color
\n Default icon color \n \n \n \n
\n \n $pt-icon-color-hover
\n Hovered icon color \n \n \n \n
\n \n $pt-icon-color-disabled
\n Disabled icon color \n \n \n \n
\n \n $pt-icon-color-selected
\n Selected icon color \n \n \n \n
\n \n $pt-dark-icon-color
\n Dark theme default icon color \n \n \n \n
\n \n $pt-dark-icon-color-hover
\n Dark theme hovered icon color \n \n \n \n
\n \n $pt-dark-icon-color-disabled
\n Dark theme disabled icon color \n \n \n \n
\n \n $pt-dark-icon-color-selected
\n Dark theme selected icon color \n \n \n \n \n
\n \n $pt-divider-black
\n Black divider color \n \n \n \n
\n \n $pt-dark-divider-black
\n Dark theme black divider color \n \n \n \n
\n \n $pt-dark-divider-white
\n Dark theme white divider color \n \n \n \n \n
\n \n $pt-code-text-color
\n Code text color \n \n \n \n
\n \n $pt-code-background-color
\n Code background color \n \n \n \n
\n \n $pt-dark-code-text-color
\n Dark theme code text color \n \n \n \n
\n \n $pt-dark-code-background-color
\n Dark theme code background color \n \n \n
\n","metadata":{}},"colors":{"reference":"colors","route":"core/colors","title":"Colors","contents":[{"tag":"heading","value":"Colors","level":1,"route":"core/colors"},"Hex values for these colors can be accessed in JavaScript. The global version of the module exposes\nthe Blueprint.Colors
object. In CommonJS, you may import { Colors } from "@blueprintjs/core"
.
\n",{"tag":"heading","value":"Gray scale","level":2,"route":"core/colors.gray-scale"},"Black, white and everything in between. The gray scale should be used for\nthe main UI frame: containers, headers, sections, boxes, etc.\nIf you need to call attention to a particular element (buttons, icons, tooltips, etc.),\nuse one of the core colors .
\n",{"tag":"reactDocs","value":"GrayscalePalette"},{"tag":"heading","value":"Core colors","level":2,"route":"core/colors.core-colors"},"Core colors are reserved for user interface design. Use these to help call\nattention to specific UI elements, such as buttons, callouts, icons, etc.\nEach core color is mapped to what we call a visual intent . We use intents\nto convey the status of UI elements:
\n\nBlue (intent: primary) elevates elements from the typical gray scale UI frame. \nGreen (intent: success) indicates successful operations. \nOrange (intent: warning) indicates warnings and intermediate states. \nRed (intent: danger) indicates errors and potentially destructive operations. \n \nCore colors are also designed to:
\n\ngo well together and be used alongside each other in any application. \nadhere to WCAG 2.0 standards, and therefore are\nhighly accessible to visually impaired and color blind users. \n \n",{"tag":"reactDocs","value":"CoreColorsPalette"},{"tag":"heading","value":"Extended colors","level":2,"route":"core/colors.extended-colors"},"Extended colors should typically be reserved for data visualizations: any time\nyou need to represent data of some sort, you can use these.\nThese colors are less strict on WCAG 2.0 \naccessibility standards and should therefore not be used for typical user\ninterface design — take a look at core colors instead.
\n",{"tag":"reactDocs","value":"ExtendedColorsPalette"},{"tag":"heading","value":"Color schemes","level":2,"route":"core/colors.color-schemes"},"Use the following color scheme generators to produce color schemes for your data visualizations.\nFirst, choose the kind of scheme based on the type of your data, then customize the number of values\nusing the forms below. Finally, copy the colors array into your application and make it live!
\nThe following schemes have been carefully crafted to be visually striking and easily understandable\nwhile remaining accessible to visually impaired and color blind users.
\n",{"tag":"heading","value":"Sequential color schemes","level":3,"route":"core/colors.sequential-color-schemes"},"Sequential color schemes imply order and are best suited for representing data that\nranges from low-to-high values either on an ordinal or on a numerical scale.
\n",{"tag":"reactDocs","value":"SequentialSchemePalette"},{"tag":"heading","value":"Diverging color schemes","level":3,"route":"core/colors.diverging-color-schemes"},"Diverging color schemes put equal emphasis on mid-range values and extremes\nat both ends of the data range.
\n",{"tag":"reactDocs","value":"DivergingSchemePalette"},{"tag":"heading","value":"Qualitative color schemes","level":3,"route":"core/colors.qualitative-color-schemes"},"Qualitative color schemes use a series of unrelated colors to create a\nscheme that does not imply order, merely difference in kind.
\n",{"tag":"reactDocs","value":"QualitativeSchemePalette"},{"tag":"heading","value":"Color aliases","level":2,"route":"core/colors.color-aliases"},"These variables are semantic aliases of our colors .\nThey are used throughout Blueprint itself to ensure consistent color usage across components.
\n\n \n \n \n Variable \n Description \n \n \n \n \n \n
\n \n $pt-intent-primary
\n Primary intent color \n \n \n \n
\n \n $pt-intent-success
\n Success intent color \n \n \n \n
\n \n $pt-intent-warning
\n Warning intent color \n \n \n \n
\n \n $pt-intent-danger
\n Danger intent color \n \n \n \n \n
\n \n $pt-app-background-color
\n Application background color \n \n \n \n
\n \n $pt-dark-app-background-color
\n Dark theme application background color \n \n \n \n \n
\n \n $pt-text-color
\n Default text color \n \n \n \n
\n \n $pt-text-color-muted
\n Muted text color \n \n \n \n
\n \n $pt-text-color-disabled
\n Disabled text color \n \n \n \n
\n \n $pt-heading-color
\n Text color for headers \n \n \n \n
\n \n $pt-link-color
\n Text color for links \n \n \n \n
\n \n $pt-dark-text-color
\n Dark theme default text color \n \n \n \n
\n \n $pt-dark-text-color-muted
\n Dark theme muted text color \n \n \n \n
\n \n $pt-dark-text-color-disabled
\n Dark theme disabled text color \n \n \n \n
\n \n $pt-dark-heading-color
\n Dark theme text color for headers \n \n \n \n
\n \n $pt-dark-link-color
\n Dark theme text color for links \n \n \n \n
\n \n $pt-text-selection-color
\n Text selection color \n \n \n \n \n
\n \n $pt-icon-color
\n Default icon color \n \n \n \n
\n \n $pt-icon-color-hover
\n Hovered icon color \n \n \n \n
\n \n $pt-icon-color-disabled
\n Disabled icon color \n \n \n \n
\n \n $pt-icon-color-selected
\n Selected icon color \n \n \n \n
\n \n $pt-dark-icon-color
\n Dark theme default icon color \n \n \n \n
\n \n $pt-dark-icon-color-hover
\n Dark theme hovered icon color \n \n \n \n
\n \n $pt-dark-icon-color-disabled
\n Dark theme disabled icon color \n \n \n \n
\n \n $pt-dark-icon-color-selected
\n Dark theme selected icon color \n \n \n \n \n
\n \n $pt-divider-black
\n Black divider color \n \n \n \n
\n \n $pt-dark-divider-black
\n Dark theme black divider color \n \n \n \n
\n \n $pt-dark-divider-white
\n Dark theme white divider color \n \n \n \n \n
\n \n $pt-code-text-color
\n Code text color \n \n \n \n
\n \n $pt-code-background-color
\n Code background color \n \n \n \n
\n \n $pt-dark-code-text-color
\n Dark theme code text color \n \n \n \n
\n \n $pt-dark-code-background-color
\n Dark theme code background color \n \n \n
\n"],"contentsRaw":"@# Colors\n\nHex values for these colors can be accessed in JavaScript. The global version of the module exposes\nthe `Blueprint.Colors` object. In CommonJS, you may `import { Colors } from \"@blueprintjs/core\"`.\n\n@## Gray scale\n\nBlack, white and everything in between. The gray scale should be used for\nthe main UI frame: containers, headers, sections, boxes, etc.\nIf you need to call attention to a particular element (buttons, icons, tooltips, etc.),\nuse one of the [core colors](#colors.core-colors).\n\n@reactDocs GrayscalePalette\n\n@## Core colors\n\nCore colors are reserved for user interface design. Use these to help call\nattention to specific UI elements, such as buttons, callouts, icons, etc.\nEach core color is mapped to what we call a __visual intent__. We use intents\nto convey the status of UI elements:\n\n- _Blue_ (intent: primary) elevates elements from the typical gray scale UI frame.\n- _Green_ (intent: success) indicates successful operations.\n- _Orange_ (intent: warning) indicates warnings and intermediate states.\n- _Red_ (intent: danger) indicates errors and potentially destructive operations.\n\nCore colors are also designed to:\n\n- go well together and be used alongside each other in any application.\n- adhere to [WCAG 2.0](https://www.w3.org/TR/WCAG20/) standards, and therefore are\nhighly accessible to visually impaired and color blind users.\n\n@reactDocs CoreColorsPalette\n\n@## Extended colors\n\nExtended colors should typically be reserved for data visualizations: any time\nyou need to represent data of some sort, you can use these.\nThese colors are less strict on [WCAG 2.0](https://www.w3.org/TR/WCAG20/)\naccessibility standards and should therefore not be used for typical user\ninterface design — take a look at [core colors](#colors.core-colors) instead.\n\n@reactDocs ExtendedColorsPalette\n\n@## Color schemes\n\nUse the following color scheme generators to produce color schemes for your data visualizations.\nFirst, choose the kind of scheme based on the type of your data, then customize the number of values\nusing the forms below. Finally, copy the colors array into your application and make it live!\n\nThe following schemes have been carefully crafted to be visually striking and easily understandable\nwhile remaining accessible to visually impaired and color blind users.\n\n@### Sequential color schemes\n\nSequential color schemes imply order and are best suited for representing data that\nranges from low-to-high values either on an ordinal or on a numerical scale.\n\n@reactDocs SequentialSchemePalette\n\n@### Diverging color schemes\n\nDiverging color schemes put equal emphasis on mid-range values and extremes\nat both ends of the data range.\n\n@reactDocs DivergingSchemePalette\n\n@### Qualitative color schemes\n\nQualitative color schemes use a series of unrelated colors to create a\nscheme that does not imply order, merely difference in kind.\n\n@reactDocs QualitativeSchemePalette\n\n@include color-aliases\n","metadata":{}},"icons":{"reference":"icons","route":"core/icons","title":"Icons","contents":[{"tag":"heading","value":"Icons","level":1,"route":"core/icons"},"Blueprint provides over 300 UI icons in an icon font. They come in two sizes, 16px and 20px, and can\nbe used anywhere text is used. It's easy to change their color or apply effects like text shadows\nvia standard CSS properties.
\nThere are two ways of using Blueprint UI icons, described in more detail in the\nIcon component documentation :
\n\nReact component: <Icon iconName="more" />
\nCSS classes: <span className="pt-icon-standard pt-icon-more />
\n \nMany Blueprint components provide an iconName
prop, which supports both the\nfull name pt-icon-projects
and the short name projects
.
\n",{"tag":"reactDocs","value":"Icons"}],"contentsRaw":"@# Icons\n\nBlueprint provides over 300 UI icons in an icon font. They come in two sizes, 16px and 20px, and can\nbe used anywhere text is used. It's easy to change their color or apply effects like text shadows\nvia standard CSS properties.\n\nThere are two ways of using Blueprint UI icons, described in more detail in the\n[**Icon component documentation**](#core/components/icon):\n1. React component: ` `\n2. CSS classes: ` `\n\nMany Blueprint [components](#core/components) provide an `iconName` prop, which supports both the\nfull name `pt-icon-projects` and the short name `projects`.\n\n@reactDocs Icons\n","metadata":{}},"core":{"reference":"core","route":"core","title":"Core","contents":[{"tag":"heading","value":"Core","level":1,"route":"core"},"The @blueprintjs/core NPM package is the basis of any Blueprint app. It includes many (30+)\nReact components covering all the basic bases, from buttons to form controls to tooltips and trees.\nIt also includes CSS styles for every component and the tools to style your own components and apps\nwith Sass and Less variables, an elegant color palette, and 300+ UI icons in two sizes.
\n",{"tag":"page","value":"accessibility"},{"tag":"page","value":"colors"},{"tag":"page","value":"typography"},{"tag":"page","value":"icons"},{"tag":"page","value":"variables"},{"tag":"page","value":"components"},{"tag":"page","value":"resources"}],"contentsRaw":"\n@# Core\n\nThe __@blueprintjs/core__ NPM package is the basis of any Blueprint app. It includes many (30+)\nReact components covering all the basic bases, from buttons to form controls to tooltips and trees.\nIt also includes CSS styles for every component and the tools to style your own components and apps\nwith Sass and Less variables, an elegant color palette, and 300+ UI icons in two sizes.\n\n@page accessibility\n@page colors\n@page typography\n@page icons\n@page variables\n@page components\n@page resources\n","metadata":{"reference":"core"}},"resources":{"reference":"resources","route":"core/resources","title":"Resources","contents":[{"tag":"heading","value":"Resources","level":1,"route":"core/resources"},{"tag":"heading","value":"Sketch assets","level":2,"route":"core/resources.sketch-assets"},"\n Core Kit.sketch \n Last updated April 3, 2017 \n \n\n Blueprint Colors.sketchpalette \n Last updated March 22, 2016 \n
\n"],"contentsRaw":"@# Resources\n\n@## Sketch assets\n\n\n Core Kit.sketch \n Last updated April 3, 2017 \n \n\n Blueprint Colors.sketchpalette \n Last updated March 22, 2016 \n \n","metadata":{}},"typography":{"reference":"typography","route":"core/typography","title":"Typography","contents":[{"tag":"heading","value":"Typography","level":1,"route":"core/typography"},{"tag":"heading","value":"Usage","level":2,"route":"core/typography.usage"},"Keep in mind these general web typography guidelines when building your applications.
\n\nThe default text color in all components is compliant with the recommended\nWCAG 2.0 minimum contrast ratio. \nIf you choose to go with a custom text color, make sure the background behind it provides\nproper contrast. \nTry not to explicitly write pixel values for your font-size or line-height CSS rules.\nInstead, reference the classes and variables we provide in Blueprint (.pt-ui-text
,\n$pt-font-size-large
, etc.). \n \n",{"tag":"heading","value":"Fonts","level":2,"route":"core/typography.fonts"},"Blueprint does not include any fonts of its own; it will use the default sans-serif operating system\nfont. We provide a class to use the default monospace font instead.
\n",{"tag":"css","value":"fonts"},{"tag":"heading","value":"Headings","level":2,"route":"core/typography.headings"},{"tag":"css","value":"headings"},{"tag":"heading","value":"UI text","level":2,"route":"core/typography.ui-text"},"The base font size for Blueprint web applications is 14px. This should be the default type size\nfor most short strings of text which are not headings or titles. If you wish to reset some\nelement's font size and line height to the default base styles, use the .pt-ui-text
class.\nFor longer running text, see running text styles .
\n",{"tag":"css","value":"pt-ui-text"},{"tag":"heading","value":"Running text","level":2,"route":"core/typography.running-text"},"Longform text, such as rendered Markdown documents, benefit from additional spacing and slightly\nlarge font size. Apply .pt-running-text
to the parent element to adjust spacing for the following\nelements:
\n\n<p>
tags have increased line-height and font size. \n<h*>
tag margins are adjusted to provide clear separation between sections in a document. \n<ul>
and <ol>
tags receive .pt-list
styles for legibility. \n \n",{"tag":"css","value":"pt-running-text"},{"tag":"heading","value":"Links","level":2,"route":"core/typography.links"},"Simply use an <a href="">
tag as you normally would. No class is necessary for Blueprint styles.\nLinks are underlined only when hovered.
\nPutting an icon inside a link will cause it to inherit the link's text color.
\n",{"tag":"heading","value":"Preformatted text","level":2,"route":"core/typography.preformatted-text"},"Use <pre>
for code blocks, and <code>
for inline code. Note that <pre>
blocks will\nretain all whitespace so you'll have to format the content accordingly.
\n",{"tag":"css","value":"preformatted"},{"tag":"heading","value":"Block quotes","level":2,"route":"core/typography.block-quotes"},"Block quotes are treated as running text.
\n",{"tag":"css","value":"blockquote"},{"tag":"heading","value":"Lists","level":2,"route":"core/typography.lists"},"Blueprint provides a small amount of global styling and a few modifier classes for list elements.
\n<ul>
and <ol>
elements in blocks with the .pt-running-text
modifier class will\nautomatically assume the .pt-list
styles to promote readability.
\n",{"tag":"css","value":"lists"},{"tag":"heading","value":"Text utilities","level":2,"route":"core/typography.text-utilities"},"Blueprint provides a small handful of class-based text utilities which can applied to any element\nthat contains text.
\n",{"tag":"css","value":"utilities"},{"tag":"heading","value":"Internationalization","level":2,"route":"core/typography.internationalization"},"I18n in Blueprint is straightforward. React components expose props for customizing any strings;\nuse the library of your choice for managing internationalized strings.
\n",{"tag":"heading","value":"Right-to-left text","level":3,"route":"core/typography.right-to-left-text"},"Use the utility class .pt-rtl
.
\n",{"tag":"css","value":"pt-rtl"},{"tag":"heading","value":"Dark theme","level":2,"route":"core/typography.dark-theme"},"Blueprint provides two UI color themes: light and dark. The light theme is active by default. The\ndark theme can be applied by adding the class pt-dark
to a container element to theme all nested\nelements.
\nOnce applied, the dark theme will cascade to nested .pt-*
elements inside a .pt-dark
container.\nThere is no way to nest light-themed elements inside a dark container.
\nMost elements only support the dark theme when nested inside a .pt-dark
container because it does\nnot make sense to mark individual elements as dark. The dark container is therefore responsible for\nsetting a dark background color.
\nThe following elements and components support the .pt-dark
class directly (i.e, .pt-app.pt-dark
)\nand can be used as a container for nested dark children:
\n\n.pt-app
\n.pt-card
\nOverlays: Dialog
, Popover
, Tooltip
, Toast
\nPopover
and Tooltip
will automatically detect when their trigger is inside a .pt-dark
\ncontainer and add the same class to themselves. \n \nRather than illustrating dark components inline, this documentation site provides a site-wide switch\nin the top right corner of the page to enable the dark theme. Try it out as you read the docs.
\n"],"contentsRaw":"@# Typography\n\n@## Usage\n\nKeep in mind these general web typography guidelines when building your applications.\n\n- The default text color in all components is compliant with the recommended\n[WCAG 2.0](https://www.w3.org/TR/WCAG20/) minimum contrast ratio.\n- If you choose to go with a custom text color, make sure the background behind it provides\nproper contrast.\n- Try not to explicitly write pixel values for your font-size or line-height CSS rules.\nInstead, reference the classes and variables we provide in Blueprint (`.pt-ui-text`,\n`$pt-font-size-large`, etc.).\n\n@## Fonts\n\nBlueprint does not include any fonts of its own; it will use the default sans-serif operating system\nfont. We provide a class to use the default monospace font instead.\n\n\n@css fonts\n\n@## Headings\n\n@css headings\n\n@## UI text\n\nThe base font size for Blueprint web applications is 14px. This should be the default type size\nfor most short strings of text which are not headings or titles. If you wish to reset some\nelement's font size and line height to the default base styles, use the `.pt-ui-text` class.\nFor longer running text, see [running text styles](#core/typography.running-text).\n\n@css pt-ui-text\n\n@## Running text\n\nLongform text, such as rendered Markdown documents, benefit from additional spacing and slightly\nlarge font size. Apply `.pt-running-text` to the parent element to adjust spacing for the following\nelements:\n\n- `` tags have increased line-height and font size.\n- `` tag margins are adjusted to provide clear separation between sections in a document.\n- `` and `` tags receive [`.pt-list`](#core/typography.lists) styles for legibility.\n\n@css pt-running-text\n\n@## Links\n\nSimply use an `` tag as you normally would. No class is necessary for Blueprint styles.\nLinks are underlined only when hovered.\n\nPutting an icon inside a link will cause it to inherit the link's text color.\n\n@## Preformatted text\n\nUse `` for code blocks, and `` for inline code. Note that `` blocks will\nretain _all_ whitespace so you'll have to format the content accordingly.\n\n@css preformatted\n\n@## Block quotes\n\nBlock quotes are treated as running text.\n\n@css blockquote\n\n@## Lists\n\nBlueprint provides a small amount of global styling and a few modifier classes for list elements.\n\n` ` and `` elements in blocks with the `.pt-running-text` modifier class will\nautomatically assume the `.pt-list` styles to promote readability.\n\n@css lists\n\n@## Text utilities\n\nBlueprint provides a small handful of class-based text utilities which can applied to any element\nthat contains text.\n\n@css utilities\n\n@## Internationalization\n\nI18n in Blueprint is straightforward. React components expose props for customizing any strings;\nuse the library of your choice for managing internationalized strings.\n\n@### Right-to-left text\n\nUse the utility class `.pt-rtl`.\n\n@css pt-rtl\n\n@## Dark theme\n\nBlueprint provides two UI color themes: light and dark. The light theme is active by default. The\ndark theme can be applied by adding the class `pt-dark` to a container element to theme all nested\nelements.\n\nOnce applied, the dark theme will cascade to nested `.pt-*` elements inside a `.pt-dark` container.\nThere is no way to nest light-themed elements inside a dark container.\n\nMost elements only support the dark theme when nested inside a `.pt-dark` container because it does\nnot make sense to mark individual elements as dark. The dark container is therefore responsible for\nsetting a dark background color.\n\nThe following elements and components support the `.pt-dark` class directly (i.e, `.pt-app.pt-dark`)\nand can be used as a container for nested dark children:\n\n- `.pt-app`\n- `.pt-card`\n- Overlays: `Dialog`, `Popover`, `Tooltip`, `Toast`\n- `Popover` and `Tooltip` will automatically detect when their trigger is inside a `.pt-dark`\ncontainer and add the same class to themselves.\n\nRather than illustrating dark components inline, this documentation site provides a site-wide switch\nin the top right corner of the page to enable the dark theme. Try it out as you read the docs.\n","metadata":{}},"variables":{"reference":"variables","route":"core/variables","title":"Variables","contents":[{"tag":"heading","value":"Variables","level":1,"route":"core/variables"},"Available for use with Sass and Less.
\n@ import " path/to/@blueprintjs/core/dist/variables " ;
The Sass $
convention is used in this documentation for consistency with the original source code.\nEvery variable mentioned below is also available in variables.less
with an @
prefix instead of $
.
\n",{"tag":"heading","value":"Font variables","level":2,"route":"core/variables.font-variables"},"Typically, correct typography styles should be achieved by using the proper HTML tag (<p>
for\ntext, <h*>
for headings, <code>
for code, etc.). The following variables are provided for the\nrare cases where custom styling is necessary and should be used sparingly:
\n\n$pt-font-family
\n$pt-font-family-monospace
\n$pt-font-size
\n$pt-font-size-small
\n$pt-font-size-large
\n$pt-line-height
\n \nSee the Fonts section for more information and usage guidelines.
\n",{"tag":"heading","value":"Icon variables","level":2,"route":"core/variables.icon-variables"},"Most icons should be displayed using the span.pt-icon-*
classes or via modifier classes on\ncomponents like .pt-button
. In rare cases, you may need direct access to the content\nstring that generates each icon in the icon font. Blueprint provides these variables with\nstraightforward names (see the Icons section for the full list of identifiers):
\n\n$pt-icon-style
\n$pt-icon-align-left
\n$pt-icon-align-center
\n... \n \nVariables are also provided for the two icon font families and their pixel sizes:
\n\n$icons16-family
\n$icons20-family
\n$pt-icon-size-standard
\n$pt-icon-size-large
\n \n",{"tag":"heading","value":"Grids & dimensions","level":2,"route":"core/variables.grids---dimensions"},"Sizes of common components. Most sizing variables are based on $pt-grid-size
, which has\na value of 10px
. Custom components should adhere to the relevant height
variable.
\n\n$pt-grid-size
\n$pt-border-radius
\n$pt-button-height
\n$pt-button-height-large
\n$pt-input-height
\n$pt-input-height-large
\n$pt-navbar-height
\n \n",{"tag":"heading","value":"Grid system","level":3,"route":"core/variables.grid-system"},"Blueprint doesn't provide a grid system. In general, you should try to use the $pt-grid-size
\nvariable to generate layout & sizing style rules in your CSS codebase.
\nIn lieu of a full grid system, you should try to use the CSS flexible box layout model (a.k.a.\n"flexbox"). It's quite powerful on its own and allows you to build robust, responsive layouts\nwithout writing much CSS. Here are some resources for learning flexbox:
\n\n",{"tag":"heading","value":"Layering","level":2,"route":"core/variables.layering"},"Blueprint provides variables for three z-index layers. This should be enough for most use cases,\nespecially if you make correct use of stacking context . Overlay \ncomponents such as dialogs and popovers use these z-index values to configure their stacking\ncontexts.
\n\n$pt-z-index-base
\n$pt-z-index-content
\n$pt-z-index-overlay
\n \n",{"tag":"heading","value":"Light theme styles","level":2,"route":"core/variables.light-theme-styles"},"Use these when you need to build custom UI components that look similar to Blueprint's\nlight theme components.
\n\n$pt-dialog-box-shadow
\n$pt-input-box-shadow
\n$pt-popover-box-shadow
\n$pt-tooltip-box-shadow
\n \n",{"tag":"heading","value":"Dark theme styles","level":2,"route":"core/variables.dark-theme-styles"},"Use these when you need to build custom UI components that look similar to Blueprint's\ndark theme components.
\n\n$pt-dark-dialog-box-shadow
\n$pt-dark-input-box-shadow
\n$pt-dark-popover-box-shadow
\n$pt-dark-tooltip-box-shadow
\n \n"],"contentsRaw":"@# Variables\n\nAvailable for use with Sass and Less.\n\n```css.scss\n@import \"path/to/@blueprintjs/core/dist/variables\";\n```\n\nThe Sass `$` convention is used in this documentation for consistency with the original source code.\nEvery variable mentioned below is also available in `variables.less` with an `@` prefix instead of `$`.\n\n@## Font variables\n\nTypically, correct typography styles should be achieved by using the proper HTML tag (`` for\ntext, `` for headings, `` for code, etc.). The following variables are provided for the\nrare cases where custom styling is necessary and should be used sparingly:\n\n- `$pt-font-family`\n- `$pt-font-family-monospace`\n- `$pt-font-size`\n- `$pt-font-size-small`\n- `$pt-font-size-large`\n- `$pt-line-height`\n\nSee the [Fonts section](#core/typography.fonts) for more information and usage guidelines.\n\n@## Icon variables\n\nMost icons should be displayed using the `span.pt-icon-*` classes or via modifier classes on\ncomponents like `.pt-button`. In rare cases, you may need direct access to the content\nstring that generates each icon in the icon font. Blueprint provides these variables with\nstraightforward names (see the [Icons section](#core/icons) for the full list of identifiers):\n\n- `$pt-icon-style`\n- `$pt-icon-align-left`\n- `$pt-icon-align-center`\n- ...\n\nVariables are also provided for the two icon font families and their pixel sizes:\n\n- `$icons16-family`\n- `$icons20-family`\n- `$pt-icon-size-standard`\n- `$pt-icon-size-large`\n\n@## Grids & dimensions\n\nSizes of common components. Most sizing variables are based on `$pt-grid-size`, which has\na value of `10px`. Custom components should adhere to the relevant `height` variable.\n\n- `$pt-grid-size`\n- `$pt-border-radius`\n- `$pt-button-height`\n- `$pt-button-height-large`\n- `$pt-input-height`\n- `$pt-input-height-large`\n- `$pt-navbar-height`\n\n@### Grid system\n\nBlueprint doesn't provide a grid system. In general, you should try to use the `$pt-grid-size`\nvariable to generate layout & sizing style rules in your CSS codebase.\n\nIn lieu of a full grid system, you should try to use the __CSS flexible box layout model__ (a.k.a.\n\"flexbox\"). It's quite powerful on its own and allows you to build robust, responsive layouts\nwithout writing much CSS. Here are some resources for learning flexbox:\n- [MDN guide](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes)\n- [CSS Tricks guide](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)\n\n@## Layering\n\nBlueprint provides variables for three z-index layers. This should be enough for most use cases,\nespecially if you make correct use of [stacking context][MDN]. [Overlay](#core/components/overlay)\ncomponents such as dialogs and popovers use these z-index values to configure their stacking\ncontexts.\n\n- `$pt-z-index-base`\n- `$pt-z-index-content`\n- `$pt-z-index-overlay`\n\n[MDN]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n\n@## Light theme styles\n\nUse these when you need to build custom UI components that look similar to Blueprint's\nlight theme components.\n\n- `$pt-dialog-box-shadow`\n- `$pt-input-box-shadow`\n- `$pt-popover-box-shadow`\n- `$pt-tooltip-box-shadow`\n\n@## Dark theme styles\n\nUse these when you need to build custom UI components that look similar to Blueprint's\ndark theme components.\n\n- `$pt-dark-dialog-box-shadow`\n- `$pt-dark-input-box-shadow`\n- `$pt-dark-popover-box-shadow`\n- `$pt-dark-tooltip-box-shadow`\n","metadata":{}},"dateinput":{"reference":"dateinput","route":"datetime/dateinput","title":"Date input","contents":[{"tag":"heading","value":"Date input","level":1,"route":"datetime/dateinput"},"The DateInput
component is an input group that shows a DatePicker
in a Popover
on focus.
\nUse the onChange
function to listen for changes to the selected date. Use onError
to listen for\ninvalid entered dates.
\nYou can control the selected date by setting the value
prop, or use the component in uncontrolled\nmode and specify an initial date by setting defaultValue
.
\nUse this component in forms where the user must enter a date.
\n",{"tag":"reactExample","value":"DateInputExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"datetime/dateinput.javascript-api"},"The DateInput
component is available in the @blueprintjs/datetime package.\nMake sure to review the general usage docs for JS components .
\nimport { DateInput } from " @blueprintjs/datetime " ;
< DateInput value = { this . state . date } onChange = { this . handleDateChange } />
",{"tag":"interface","value":"IDateInputProps"}],"contentsRaw":"@# Date input\n\nThe `DateInput` component is an [input group](#core/components/forms/input-group) that shows a [`DatePicker`](#datetime/datepicker) in a [`Popover`](#core/components/popover) on focus.\n\nUse the `onChange` function to listen for changes to the selected date. Use `onError` to listen for\ninvalid entered dates.\n\nYou can control the selected date by setting the `value` prop, or use the component in uncontrolled\nmode and specify an initial date by setting `defaultValue`.\n\nUse this component in forms where the user must enter a date.\n\n@reactExample DateInputExample\n\n@## JavaScript API\n\nThe `DateInput` component is available in the __@blueprintjs/datetime__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n```tsx\nimport { DateInput } from \"@blueprintjs/datetime\";\n\n \n```\n\n@interface IDateInputProps\n","metadata":{}},"datepicker":{"reference":"datepicker","route":"datetime/datepicker","title":"Date picker","contents":[{"tag":"heading","value":"Date picker","level":1,"route":"datetime/datepicker"},"A DatePicker
shows a monthly calendar and allows the user to choose a single date.
\nDatePicker
s behave similarly to standard React form inputs .
\nUse the onChange
prop to listen for changes to the selected day.\nYou can control the selected day by setting the value
prop, or use the component in uncontrolled\nmode and specify an initial day by setting defaultValue
.
\nDatePicker
uses Moment.js to handle localization. You can use locale
and\nthe localeUtils
functions to specify a locale. See\nthis file \nfor an example of defining localeUtils
functions using Moment.js.
\nDatePicker
is built on top of the react-day-picker library.
\n",{"tag":"reactExample","value":"DatePickerExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"datetime/datepicker.javascript-api"},"The DatePicker
component is available in the @blueprintjs/datetime package.\nMake sure to review the general usage docs for JS components .
\nSome props are managed by the DatePicker
component, while others are passed\nto the react-day-picker library. These passed props are documented in full\nin the react-day-picker documentation .
\n",{"tag":"interface","value":"IDatePickerProps"},{"tag":"heading","value":"Using modifiers","level":2,"route":"datetime/datepicker.using-modifiers"},"You can use the modifiers
prop to conditionally apply styles to days. Modifiers are documented in\nfull in the react-day-picker documentation .
\nThe example below creates a DatePicker
that prevents the user from selecting any Sundays,\nby using the component in controlled mode and with the modifiers
prop:
\n
. pt-datepicker . DayPicker-Day--isSunday {
}
export class DatePickerExample extends React . Component < { } , { selectedDate : Date } > {
public state = { selectedDate : new Date ( ) } ;
public render ( ) {
const modifiers = { isSunday } ;
return (
< DatePicker
modifiers = { modifiers }
onChange = { ( newDate ) => this . handleChange ( newDate ) }
value = { this . state . selectedDate }
/>
) ;
}
private handleChange ( date : Date ) {
if ( ! isSunday ( date ) ) {
this . setState ( { selectedDate : date } ) ;
}
}
}
function isSunday ( date : Date ) {
return date . getDay ( ) === 0 ;
}
"],"contentsRaw":"@# Date picker\n\nA `DatePicker` shows a monthly calendar and allows the user to choose a single date.\n\n`DatePicker`s behave similarly to standard [React form inputs](https://facebook.github.io/react/docs/forms.html).\n\nUse the `onChange` prop to listen for changes to the selected day.\nYou can control the selected day by setting the `value` prop, or use the component in uncontrolled\nmode and specify an initial day by setting `defaultValue`.\n\n`DatePicker` uses [Moment.js](http://momentjs.com/) to handle localization. You can use `locale` and\nthe `localeUtils` functions to specify a locale. See\n[this file](https://github.com/gpbl/react-day-picker/blob/master/src/addons/MomentLocaleUtils.js)\nfor an example of defining `localeUtils` functions using Moment.js.\n\n`DatePicker` is built on top of the [**react-day-picker**](https://github.com/gpbl/react-day-picker) library.\n\n@reactExample DatePickerExample\n\n@## JavaScript API\n\nThe `DatePicker` component is available in the __@blueprintjs/datetime__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\nSome props are managed by the `DatePicker` component, while others are passed\nto the **react-day-picker** library. These passed props are documented in full\nin the [**react-day-picker** documentation](http://www.gpbl.org/react-day-picker/index.html).\n\n@interface IDatePickerProps\n\n@## Using modifiers\n\nYou can use the `modifiers` prop to conditionally apply styles to days. Modifiers are documented in\nfull in the [**react-day-picker** documentation](http://react-day-picker.js.org/Modifiers.html).\n\nThe example below creates a `DatePicker` that prevents the user from selecting any Sundays,\nby using the component in controlled mode and with the `modifiers` prop:\n\n```css.scss\n// in CSS\n.pt-datepicker .DayPicker-Day--isSunday {\n // CSS rules to make the day appear disabled\n}\n```\n\n```tsx\n// in TypeScript\nexport class DatePickerExample extends React.Component<{}, { selectedDate: Date }> {\n public state = { selectedDate: new Date() };\n\n public render() {\n // name of modifier function, 'isSunday' is the suffix for the CSS class above\n const modifiers = { isSunday };\n return (\n this.handleChange(newDate)}\n value={this.state.selectedDate}\n />\n );\n }\n\n private handleChange(date: Date) {\n if (!isSunday(date)) {\n this.setState({ selectedDate: date });\n }\n }\n}\n\nfunction isSunday(date: Date) {\n return date.getDay() === 0;\n}\n```\n","metadata":{}},"daterangeinput":{"reference":"daterangeinput","route":"datetime/daterangeinput","title":"Date range input","contents":[{"tag":"heading","value":"Date range input","level":1,"route":"datetime/daterangeinput"},"The DateRangeInput
component is a control group composed of two\ninput groups . It shows a\nDateRangePicker
in a Popover
on focus.
\nUse this component in forms where the user must enter a date range.
\n",{"tag":"reactExample","value":"DateRangeInputExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"datetime/daterangeinput.javascript-api"},"The DateRangeInput
component is available in the @blueprintjs/datetime package.\nMake sure to review the general usage docs for JS components .
\nUse the onChange
function to listen for changes to the selected date. Use onError
to listen for\ninvalid entered dates or date ranges.
\nYou can control the selected date by setting the value
prop, or use the component in uncontrolled\nmode and specify an initial date by setting defaultValue
.
\nimport { DateRangeInput } from " @blueprintjs/datetime " ;
< DateRangeInput value = { [ this . state . startDate , this . state . endDate ] } onChange = { this . handleChange } />
",{"tag":"interface","value":"IDateRangeInputProps"}],"contentsRaw":"@# Date range input\n\nThe `DateRangeInput` component is a [control group](#core/components/forms/control-group) composed of two\n[input groups](#core/components/forms/input-group). It shows a\n[`DateRangePicker`](#datetime/daterangepicker) in a [`Popover`](#core/components/popover) on focus.\n\nUse this component in forms where the user must enter a date range.\n\n@reactExample DateRangeInputExample\n\n@## JavaScript API\n\nThe `DateRangeInput` component is available in the __@blueprintjs/datetime__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\nUse the `onChange` function to listen for changes to the selected date. Use `onError` to listen for\ninvalid entered dates or date ranges.\n\nYou can control the selected date by setting the `value` prop, or use the component in uncontrolled\nmode and specify an initial date by setting `defaultValue`.\n\n```\nimport { DateRangeInput } from \"@blueprintjs/datetime\";\n\n \n```\n\n@interface IDateRangeInputProps\n","metadata":{}},"daterangepicker":{"reference":"daterangepicker","route":"datetime/daterangepicker","title":"Date range picker","contents":[{"tag":"heading","value":"Date range picker","level":1,"route":"datetime/daterangepicker"},"A DateRangePicker
shows two sequential month calendars and lets the user select a single range of\ndays.
\nUse the onChange
prop to listen for changes to the set date range. You can control the selected\ndate range by setting the value
prop, or use the component in uncontrolled mode and specify an\ninitial date range by setting defaultValue
.
\nDateRangePicker
uses the DateRange
type across its API.\nThis is an alias for the tuple type [Date, Date]
.\nSemantically:
\n\n[null, null]
represents an empty selection \n[someDate, null]
represents a date range where a single day endpoint is known. \n[someDate, someOtherDate]
represents a full date range where both endpoints known. \n \n",{"tag":"reactExample","value":"DateRangePickerExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"datetime/daterangepicker.javascript-api"},"The DateRangePicker
component is available in the @blueprintjs/datetime package.\nMake sure to review the general usage docs for JS components .
\nimport { DateRangePicker } from " @blueprintjs/datetime " ;
< DateRangePicker
value = { [ this . state . startDate , this . state . endDate ] }
onChange = { this . handleDateChange }
/>
",{"tag":"interface","value":"IDateRangePickerProps"}],"contentsRaw":"@# Date range picker\n\nA `DateRangePicker` shows two sequential month calendars and lets the user select a single range of\ndays.\n\nUse the `onChange` prop to listen for changes to the set date range. You can control the selected\ndate range by setting the `value` prop, or use the component in uncontrolled mode and specify an\ninitial date range by setting `defaultValue`.\n\n`DateRangePicker` uses the `DateRange` type across its API.\nThis is an alias for the tuple type `[Date, Date]`.\nSemantically:\n* `[null, null]` represents an empty selection\n* `[someDate, null]` represents a date range where a single day endpoint is known.\n* `[someDate, someOtherDate]` represents a full date range where both endpoints known.\n\n@reactExample DateRangePickerExample\n\n@## JavaScript API\n\nThe `DateRangePicker` component is available in the __@blueprintjs/datetime__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n```tsx\nimport { DateRangePicker } from \"@blueprintjs/datetime\";\n\n\n```\n\n@interface IDateRangePickerProps\n","metadata":{}},"datetimepicker":{"reference":"datetimepicker","route":"datetime/datetimepicker","title":"Date time picker","contents":[{"tag":"heading","value":"Date time picker","level":1,"route":"datetime/datetimepicker"},"A combined component consisting of a DatePicker
\nand a TimePicker
.
\nUse the onChange
prop to listen for changes to the selected date and time. You can control the\nselected date and time by setting the value
prop, or use the component in uncontrolled\nmode and specify an initial day by setting defaultValue
. (If defaultValue
is not set,\nthe current date and time is used as the default.)
\nYou can pass props to the inner DatePicker
and TimePicker
components using\ndatePickerProps
and timePickerProps
, respectively.
\n",{"tag":"reactExample","value":"DateTimePickerExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"datetime/datetimepicker.javascript-api"},"The DateTimePicker
component is available in the @blueprintjs/datetime package.\nMake sure to review the general usage docs for JS components .
\nimport { DateTimePicker } from " @blueprintjs/datetime " ;
< DateTimePicker value = { this . state . date } onChange = { this . handleDateChange } />
",{"tag":"interface","value":"IDateTimePickerProps"}],"contentsRaw":"@# Date time picker\n\nA combined component consisting of a [`DatePicker`](#datetime/datepicker)\nand a [`TimePicker`](#datetime/timepicker).\n\nUse the `onChange` prop to listen for changes to the selected date and time. You can control the\nselected date and time by setting the `value` prop, or use the component in uncontrolled\nmode and specify an initial day by setting `defaultValue`. (If `defaultValue` is not set,\nthe current date and time is used as the default.)\n\nYou can pass props to the inner `DatePicker` and `TimePicker` components using\n`datePickerProps` and `timePickerProps`, respectively.\n\n@reactExample DateTimePickerExample\n\n@## JavaScript API\n\nThe `DateTimePicker` component is available in the __@blueprintjs/datetime__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n```tsx\nimport { DateTimePicker } from \"@blueprintjs/datetime\";\n\n \n```\n\n@interface IDateTimePickerProps\n","metadata":{}},"datetime":{"reference":"datetime","route":"datetime","title":"Datetime","contents":[{"tag":"heading","value":"Datetime","level":1,"route":"datetime"},"The @blueprintjs/datetime NPM package provides several components for interacting with dates and times:
\n\nDatePicker
for selecting a single date (day, month, year).
\n \nDateRangePicker
for selecting date ranges.
\n \nTimePicker
for selecting a time (hour, minute, second,\nmillisecond).
\n \nDateTimePicker
, which composes DatePicker
and\nTimePicker
to select a date and time together.
\n \nDateInput
, which composes a text input with a DatePicker
in\na Popover
, for use in forms.
\n \n \nThey are available in the @blueprintjs/datetime package on\nNPM .
\nMake sure to review the general usage docs for JS components .
\nnpm install --save @blueprintjs/datetime
",{"tag":"page","value":"datepicker"},{"tag":"page","value":"daterangepicker"},{"tag":"page","value":"timepicker"},{"tag":"page","value":"datetimepicker"},{"tag":"page","value":"dateinput"},{"tag":"page","value":"daterangeinput"}],"contentsRaw":"\n@# Datetime\n\nThe __@blueprintjs/datetime__ NPM package provides several components for interacting with dates and times:\n\n- [`DatePicker`](#datetime/datepicker) for selecting a single date (day, month, year).\n\n- [`DateRangePicker`](#datetime/daterangepicker) for selecting date ranges.\n\n- [`TimePicker`](#datetime/timepicker) for selecting a time (hour, minute, second,\n millisecond).\n\n- [`DateTimePicker`](#datetime/datetimepicker), which composes `DatePicker` and\n `TimePicker` to select a date and time together.\n\n- [`DateInput`](#datetime/dateinput), which composes a text input with a `DatePicker` in\n a `Popover`, for use in forms.\n\nThey are available in the __@blueprintjs/datetime__ package on\n[NPM](https://www.npmjs.com/package/@blueprintjs/datetime).\n\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n```sh\nnpm install --save @blueprintjs/datetime\n```\n\n@page datepicker\n@page daterangepicker\n@page timepicker\n@page datetimepicker\n@page dateinput\n@page daterangeinput\n","metadata":{"reference":"datetime"}},"timepicker":{"reference":"timepicker","route":"datetime/timepicker","title":"Time picker","contents":[{"tag":"heading","value":"Time picker","level":1,"route":"datetime/timepicker"},"A TimePicker
allows the user to specify a time.
\nTimePicker
s behave similarly to standard React form inputs .
\nUse the onChange
prop to listen for changes to the set time. You can control the selected time by\nsetting the value
prop, or use the component in uncontrolled mode and specify an initial time by\nsetting defaultValue
.
\nTimePicker
has no direct localization support. You should handle localization directly in your\napplication if needed.
\nTimePicker
uses Date
objects across its API but ignores their year, month, and day fields.
\n",{"tag":"reactExample","value":"TimePickerExample"},{"tag":"heading","value":"JavaScript API","level":2,"route":"datetime/timepicker.javascript-api"},"The TimePicker
component is available in the @blueprintjs/datetime package.\nMake sure to review the general usage docs for JS components .
\n",{"tag":"interface","value":"ITimePickerProps"}],"contentsRaw":"@# Time picker\n\nA `TimePicker` allows the user to specify a time.\n\n`TimePicker`s behave similarly to standard [React form inputs](https://facebook.github.io/react/docs/forms.html).\n\nUse the `onChange` prop to listen for changes to the set time. You can control the selected time by\nsetting the `value` prop, or use the component in uncontrolled mode and specify an initial time by\nsetting `defaultValue`.\n\n`TimePicker` has no direct localization support. You should handle localization directly in your\napplication if needed.\n\n`TimePicker` uses `Date` objects across its API but ignores their year, month, and day fields.\n\n@reactExample TimePickerExample\n\n@## JavaScript API\n\nThe `TimePicker` component is available in the __@blueprintjs/datetime__ package.\nMake sure to review the [general usage docs for JS components](#blueprint.usage).\n\n@interface ITimePickerProps\n","metadata":{}},"omnibox":{"reference":"omnibox","route":"labs/omnibox","title":"Omnibox","contents":[{"tag":"heading","value":"Omnibox","level":1,"route":"labs/omnibox"},"Omnibox<T>
is a macOS Spotlight-style typeahead component composing Overlay
and QueryList<T>
. Usage is similar to Select<T>
: provide your items and a predicate to customize the filtering algorithm. The component is fully controlled via the isOpen
prop, which means you can decide exactly how to trigger the component. The following example responds to a button and a hotkey.
\n",{"tag":"reactExample","value":"OmniboxExample"},{"tag":"interface","value":"IOmniboxProps"}],"contentsRaw":"@# Omnibox\n\n`Omnibox` is a macOS Spotlight-style typeahead component composing `Overlay` and `QueryList`. Usage is similar to `Select`: provide your items and a predicate to customize the filtering algorithm. The component is fully controlled via the `isOpen` prop, which means you can decide exactly how to trigger the component. The following example responds to a button and a hotkey.\n\n@reactExample OmniboxExample\n\n@interface IOmniboxProps\n\n","metadata":{}},"popover2":{"reference":"popover2","route":"labs/popover2","title":"Popover2","contents":[{"tag":"heading","value":"Popover2","level":1,"route":"labs/popover2"},"Changes from original Popover
:
\n\nPopper.js is a massive improvement over Tether in almost every way!\nall the fancy flipping behavior you could want enabled by default \nendlessly customizable if it isn't perfect enough for you \nlook, it puts the arrow exactly where it's supposed to be. every time. \n \n \nall the classic Popover
features are still supported, with the same names except...\nisModal
→ hasBackdrop
to match corresponding prop on Overlay
\nisDisabled
→ disabled
for consistency with HTML elements \n \n \n...and except for the handful of Tether-specific props, which are now Popper.js-specific:\n \n...and one special addition:\nminimal: boolean
applies minimal styles, which includes removing the arrow and minimizing the transition \n \n \n \n",{"tag":"reactExample","value":"Popover2Example"},{"tag":"interface","value":"IPopover2Props"},{"tag":"heading","value":"Placement","level":2,"route":"labs/popover2.placement"},"Valid placements are:
\n\nauto
\ntop
\nright
\nbottom
\nleft
\n \nEach placement can have a suffix from this list, which determines the alignment along the opposite axis:
\n\n-start
\n(nothing) \n-end
\n \nFor top
and bottom
, -start
means left and -end
means right. For left
and right
, -start
means top and -end
means bottom.
\nTherefore, top-start
places the Popover along the top edge of the target and their left sides will be aligned.\nAnd right-end
places the Popover along the right edge with their bottom sides aligned.
\nauto
will choose the best suitable placement given the Popover's position within its boundary element.
\n\n\n",{"tag":"heading","value":"Modifiers","level":2,"route":"labs/popover2.modifiers"},"Modifiers are the tools through which you customize Popper.js's behavior. Popper.js defines several of its own modifiers to handle things such as flipping, preventing overflow from a boundary element, and positioning the arrow. Popover2
defines a few additional modifiers to support itself. You can even define your own modifiers, and customize the Popper.js defaults, through the modifiers
prop. (Note: it is not currently possible to configure Popover2
's modifiers through the modifiers
prop, nor can you define your own with the same name.)
\nPopper.js modifiers, which can be customized via the modifiers
prop:
\n\nshift
applies the -start
/-end
portion of placement \noffset
can be configured to move the popper on both axes using a CSS-like syntax \npreventOverflow
prevents the popper from being positioned outside the boundary \nkeepTogether
ensures the popper stays near to its reference without leaving any gap. \narrow
computes the arrow position. \nflip
flips the popper's placement when it starts to overlap its reference element. \ninner
makes the popper flow toward the inner of the reference element (disabled by default). \nhide
hides the popper when its reference element is outside of the popper boundaries. \ncomputeStyle
generates the CSS styles to apply to the DOM \n \nPopover2
modifiers, which cannot be used by you :
\n\narrowOffset
moves the popper a little bit to make room for the arrow \nupdatePopoverState
saves off some popper data to Popover2
React state for fancy things \n \n\n\n"],"contentsRaw":"@# Popover2\n\n**Changes from original [`Popover`](#core/components/popover):**\n\n- [Popper.js](https://popper.js.org) is a massive improvement over [Tether](http://tether.io/) in almost every way!\n - all the fancy flipping behavior you could want _enabled by default_\n - endlessly customizable if it isn't perfect _enough_ for you\n - look, it puts the arrow exactly where it's supposed to be. _every time._\n- all the classic `Popover` features are still supported, with the same names except...\n - `isModal` → `hasBackdrop` to match corresponding prop on `Overlay`\n - `isDisabled` → `disabled` for consistency with HTML elements\n- ...and except for the handful of Tether-specific props, which are now Popper.js-specific:\n - `position: Position` → [`placement: PopperJS.Placement`](#labs/popover2.placement)\n - `tetherOptions: ITetherOptions` → [`modifiers: PopperJS.Modifiers`](#labs/popover2.modifiers)\n- ...and one special addition:\n - `minimal: boolean` applies minimal styles, which includes removing the arrow and minimizing the transition\n\n@reactExample Popover2Example\n\n@interface IPopover2Props\n\n@## Placement\n\nValid placements are:\n\n- `auto`\n- `top`\n- `right`\n- `bottom`\n- `left`\n\nEach placement can have a suffix from this list, which determines the alignment along the opposite axis:\n\n- `-start`\n- _(nothing)_ \n- `-end`\n\nFor `top` and `bottom`, `-start` means left and `-end` means right. For `left` and `right`, `-start` means top and `-end` means bottom.\n\nTherefore, `top-start` places the Popover along the top edge of the target and their left sides will be aligned.\nAnd `right-end` places the Popover along the right edge with their bottom sides aligned.\n\n`auto` will choose the best suitable placement given the Popover's position within its boundary element.\n\n\n Read more in [the Popper.js Placement documentation](https://popper.js.org/popper-documentation.html#Popper.placements).\n
\n\n@## Modifiers\n\nModifiers are the tools through which you customize Popper.js's behavior. Popper.js defines several of its own modifiers to handle things such as flipping, preventing overflow from a boundary element, and positioning the arrow. `Popover2` defines a few additional modifiers to support itself. You can even define your own modifiers, and customize the Popper.js defaults, through the `modifiers` prop. (Note: it is not currently possible to configure `Popover2`'s modifiers through the `modifiers` prop, nor can you define your own with the same name.)\n\n**Popper.js modifiers, which can be customized via the `modifiers` prop:**\n\n- [`shift`](https://popper.js.org/popper-documentation.html#modifiers..shift) applies the `-start`/`-end` portion of placement\n- [`offset`](https://popper.js.org/popper-documentation.html#modifiers..offset) can be configured to move the popper on both axes using a CSS-like syntax\n- [`preventOverflow`](https://popper.js.org/popper-documentation.html#modifiers..preventOverflow) prevents the popper from being positioned outside the boundary\n- [`keepTogether`](https://popper.js.org/popper-documentation.html#modifiers..keepTogether) ensures the popper stays near to its reference without leaving any gap.\n- [`arrow`](https://popper.js.org/popper-documentation.html#modifiers..arrow) computes the arrow position.\n- [`flip`](https://popper.js.org/popper-documentation.html#modifiers..flip) flips the popper's placement when it starts to overlap its reference element.\n- [`inner`](https://popper.js.org/popper-documentation.html#modifiers..inner) makes the popper flow toward the inner of the reference element (disabled by default).\n- [`hide`](https://popper.js.org/popper-documentation.html#modifiers..hide) hides the popper when its reference element is outside of the popper boundaries.\n- [`computeStyle`](https://popper.js.org/popper-documentation.html#modifiers..computeStyle) generates the CSS styles to apply to the DOM\n\n**`Popover2` modifiers, _which cannot be used by you_:**\n\n- `arrowOffset` moves the popper a little bit to make room for the arrow\n- `updatePopoverState` saves off some popper data to `Popover2` React state for fancy things\n\n\n To understand all the Popper.js modifiers available to you, you'll want to read [the Popper.js Modifiers documentation](https://popper.js.org/popper-documentation.html#modifiers).\n
\n\n","metadata":{}},"query-list":{"reference":"query-list","route":"labs/query-list","title":"QueryList","contents":[{"tag":"heading","value":"QueryList","level":1,"route":"labs/query-list"},"QueryList<T>
is a higher-order component that provides interactions between a query string and a list of items. Specifically, it implements the two predicate props describe above and provides keyboard selection. It does not render anything on its own, instead deferring to a renderer
prop to perform the actual composition of components.
\nQueryList<T>
is a generic component where <T>
represents the type of one item in the array of items
. The static method QueryList.ofType<T>()
is available to simplify the TypeScript usage.
\nIf the Select
interactions are not sufficient for your use case, you can use QueryList
directly to render your own components while leveraging basic interactions for keyboard selection and filtering. The Select
source code is a great place to start when implementing a custom QueryList
renderer
.
\n",{"tag":"interface","value":"IQueryListProps"},{"tag":"heading","value":"Renderer API","level":2,"route":"labs/query-list.renderer-api"},"An object with the following properties will be passed to an QueryList
renderer
. Required properties will always be defined; optional ones will only be defined if they are passed as props to the QueryList
.
\nThis interface is generic, accepting a type parameter <T>
for an item in the list.
\n",{"tag":"interface","value":"IQueryListRendererProps"}],"contentsRaw":"@# QueryList\n\n`QueryList` is a higher-order component that provides interactions between a query string and a list of items. Specifically, it implements the two predicate props describe above and provides keyboard selection. It does not render anything on its own, instead deferring to a `renderer` prop to perform the actual composition of components.\n\n`QueryList` is a generic component where `` represents the type of one item in the array of `items`. The static method `QueryList.ofType()` is available to simplify the TypeScript usage.\n\nIf the `Select` interactions are not sufficient for your use case, you can use `QueryList` directly to render your own components while leveraging basic interactions for keyboard selection and filtering. The `Select` source code is a great place to start when implementing a custom `QueryList` `renderer`.\n\n@interface IQueryListProps\n\n@## Renderer API\n\nAn object with the following properties will be passed to an `QueryList` `renderer`. Required properties will always be defined; optional ones will only be defined if they are passed as props to the `QueryList`.\n\nThis interface is generic, accepting a type parameter `` for an item in the list.\n\n@interface IQueryListRendererProps\n","metadata":{}},"multi-select":{"reference":"multi-select","route":"labs/multi-select","title":"MultiSelect","contents":[{"tag":"heading","value":"MultiSelect","level":1,"route":"labs/multi-select"},"Use MultiSelect<T>
for choosing multiple items in a list. The component renders a TagInput
wrapped in a Popover
. Similarly to Select
, you can pass in a predicate to customize the filtering algorithm. Selection of a MultiSelect<T>
is controlled: listen to changes with onItemSelect
.
\n\n
Generic components and custom filtering \n For more information on controlled usage, generic components and custom filtering, visit the documentation for
Select<T>
.\n
\n\n",{"tag":"reactExample","value":"MultiSelectExample"},{"tag":"interface","value":"IMultiSelectProps"},{"tag":"interface","value":"ISelectItemRendererProps"}],"contentsRaw":"@# MultiSelect\n\nUse `MultiSelect` for choosing multiple items in a list. The component renders a [`TagInput`](#labs/tag-input) wrapped in a `Popover`. Similarly to [`Select`](#labs/select-component), you can pass in a predicate to customize the filtering algorithm. Selection of a `MultiSelect` is controlled: listen to changes with `onItemSelect`.\n\n\n
Generic components and custom filtering \n For more information on controlled usage, generic components and custom filtering, visit the documentation for [`Select`](#labs/select-component).\n
\n\n@reactExample MultiSelectExample\n\n@interface IMultiSelectProps\n\n@interface ISelectItemRendererProps\n","metadata":{}},"select-component":{"reference":"select-component","route":"labs/select-component","title":"Select","contents":[{"tag":"heading","value":"Select","level":1,"route":"labs/select-component"},"Use Select<T>
for choosing one item from a list. The component's children will be wrapped in a Popover2
that contains the list and an optional InputGroup
to filter it. Provide a predicate to customize the filtering algorithm. The value of a Select<T>
(the currently chosen item) is uncontrolled: listen to changes with onItemSelect
.
\n\n
Disabling a Select \n
Disabling the component requires setting the disabled
prop to true
\n and separately disabling the component's children as appropriate (because Select
accepts arbitrary children).
\n
For example, <Select ... disabled={true}><Button ... disabled={true} /></Select>
\n
\n\n",{"tag":"reactExample","value":"SelectExample"},"import { Button , MenuItem } from " @blueprintjs/core " ;
import { Select } from " @blueprintjs/labs " ;
import { Film , TOP_100_FILMS , filterFilm , renderFilm } from " ./demoData " ;
const FilmSelect = Select . ofType < Film > ( ) ;
ReactDOM . render (
< FilmSelect
items = { TOP_100_FILMS }
itemPredicate = { filterFilm }
itemRenderer = { renderFilm }
noResults = { < MenuItem disabled text = " No results. " /> }
onItemSelect = { ... }
>
{ }
< Button text = { TOP_100_FILMS [ 0 ] . title } rightIconName = " double-caret-vertical " />
</ FilmSelect > ,
document . querySelector ( " #root " )
) ;
In TypeScript, Select<T>
is a generic component so you must define a local type that specifies <T>
, the type of one item in items
. The props on this local type will now operate on your data type (speak your language) so you can easily define handlers without transformation steps, but most props are required as a result. The static Select.ofType<T>()
method is available to streamline this process. (Note that this has no effect on JavaScript usage: the Select
export is a perfectly valid React component class.)
\n",{"tag":"heading","value":"Querying","level":2,"route":"labs/select-component.querying"},"Supply a predicate to automatically query items based on the InputGroup
value. Use itemPredicate
to filter each item individually; this is great for lightweight searches. Use itemListPredicate
to query the entire array in one go, and even reorder it, such as with fuzz-aldrin-plus . The array of filtered items is cached internally by QueryList
state and only recomputed when query
or items
-related props change.
\nOmitting both itemPredicate
and itemListPredicate
props will cause the component to always render all items
. It will not hide the InputGroup
; use the filterable
prop for that. In this case, you can implement your own filtering and simply change the items
prop.
\n",{"tag":"heading","value":"Non-ideal states","level":3,"route":"labs/select-component.non-ideal-states"},"If the query returns no results or items
is empty, then noResults
will be rendered in place of the usual list. You also have the option to provide initialContent
, which will render in place of the item list if the query is empty.
\n",{"tag":"heading","value":"Controlled usage","level":2,"route":"labs/select-component.controlled-usage"},"The InputGroup
value is managed by Select
's internal state and is not exposed via props. If you would like to control it, you can circumvent Select
state by passing your value
state and onChange
handler to inputProps
. You can then query the items
array directly and omit both predicate props.
\n
< FilmSelect
inputProps = { { value : this . state . myQuery , onChange : this . handleChange } }
items = { myFilter ( ALL_ITEMS , this . state . myQuery ) }
itemRenderer = { ... }
onItemSelect = { ... }
/>
This "escape hatch" can be used to implement all sorts of advanced behavior on top of the basic Select
interactions, such as windowed filtering for large data sets.
\n",{"tag":"heading","value":"JavaScript API","level":2,"route":"labs/select-component.javascript-api"},{"tag":"interface","value":"ISelectProps"},{"tag":"heading","value":"Item Renderer API","level":3,"route":"labs/select-component.item-renderer-api"},"An object with the following properties will be passed to a Select
itemRenderer
, for each item being rendered. Only items which pass the predicate will be rendered. Don't forget to define a key
for each item, or face React's console wrath!
\nThis interface is generic, accepting a type parameter <T>
for an item in the list.
\nimport { Classes , MenuItem } from " @blueprintjs/core " ;
import { Select , ISelectItemRendererProps } from " @blueprintjs/labs " ;
const FilmSelect = Select . ofType < Film > ( ) ;
const renderMenuItem = ( { handleClick , item : film , isActive } : ISelectItemRendererProps < Film > ) => (
< MenuItem
className = { isActive ? Classes . ACTIVE : " " }
key = { film . title }
label = { film . year }
onClick = { handleClick }
text = { film . title }
/>
) ;
< FilmSelect itemRenderer = { renderMenuItem } items = { ... } onItemSelect = { ... } />
",{"tag":"interface","value":"ISelectItemRendererProps"}],"contentsRaw":"@# Select\n\nUse `Select` for choosing one item from a list. The component's children will be wrapped in a [`Popover2`](#labs/popover2) that contains the list and an optional `InputGroup` to filter it. Provide a predicate to customize the filtering algorithm. The value of a `Select` (the currently chosen item) is uncontrolled: listen to changes with `onItemSelect`.\n\n\n
Disabling a Select \n
Disabling the component requires setting the `disabled` prop to `true`\n and separately disabling the component's children as appropriate (because `Select` accepts arbitrary children).
\n
For example, ` `
\n
\n\n@reactExample SelectExample\n\n```tsx\nimport { Button, MenuItem } from \"@blueprintjs/core\";\nimport { Select } from \"@blueprintjs/labs\";\nimport { Film, TOP_100_FILMS, filterFilm, renderFilm } from \"./demoData\";\n\n// Select is a generic component to work with your data types.\n// In TypeScript, you must first obtain a non-generic reference:\nconst FilmSelect = Select.ofType();\n\nReactDOM.render(\n }\n onItemSelect={...}\n >\n {/* children become the popover target; render value here */}\n \n ,\n document.querySelector(\"#root\")\n);\n```\n\nIn TypeScript, `Select` is a *generic component* so you must define a local type that specifies ``, the type of one item in `items`. The props on this local type will now operate on your data type (speak your language) so you can easily define handlers without transformation steps, but most props are required as a result. The static `Select.ofType()` method is available to streamline this process. (Note that this has no effect on JavaScript usage: the `Select` export is a perfectly valid React component class.)\n\n@## Querying\n\nSupply a predicate to automatically query items based on the `InputGroup` value. Use `itemPredicate` to filter each item individually; this is great for lightweight searches. Use `itemListPredicate` to query the entire array in one go, and even reorder it, such as with [fuzz-aldrin-plus](https://github.com/jeancroy/fuzz-aldrin-plus). The array of filtered items is cached internally by `QueryList` state and only recomputed when `query` or `items`-related props change.\n\nOmitting both `itemPredicate` and `itemListPredicate` props will cause the component to always render all `items`. It will not hide the `InputGroup`; use the `filterable` prop for that. In this case, you can implement your own filtering and simply change the `items` prop.\n\n@### Non-ideal states\n\nIf the query returns no results or `items` is empty, then `noResults` will be rendered in place of the usual list. You also have the option to provide `initialContent`, which will render in place of the item list if the query is empty.\n\n@## Controlled usage\n\nThe `InputGroup` value is managed by `Select`'s internal state and is not exposed via props. If you would like to control it, you can circumvent `Select` state by passing your `value` state and `onChange` handler to `inputProps`. You can then query the `items` array directly and omit both predicate props.\n\n```tsx\n// controlling query involves controlling the input and doing your own filtering\n\n```\n\nThis \"escape hatch\" can be used to implement all sorts of advanced behavior on top of the basic `Select` interactions, such as windowed filtering for large data sets.\n\n@## JavaScript API\n\n@interface ISelectProps\n\n@### Item Renderer API\n\nAn object with the following properties will be passed to a `Select` `itemRenderer`, for each item being rendered. Only items which pass the predicate will be rendered. Don't forget to define a `key` for each item, or face React's console wrath!\n\nThis interface is generic, accepting a type parameter `` for an item in the list.\n\n```tsx\nimport { Classes, MenuItem } from \"@blueprintjs/core\";\nimport { Select, ISelectItemRendererProps } from \"@blueprintjs/labs\";\nconst FilmSelect = Select.ofType();\n\nconst renderMenuItem = ({ handleClick, item: film, isActive }: ISelectItemRendererProps) => (\n