# SelectionToolbar URL: /docs/primitives/selection-toolbar A floating toolbar that appears when text is selected within a message. The SelectionToolbar primitive is a floating toolbar that appears when the user selects text within a message. It lets users quote selected text into the composer. Styling and action layout are fully customizable. ```tsx import { SelectionToolbarPrimitive } from "@assistant-ui/react"; import { QuoteIcon } from "lucide-react"; function FloatingSelectionToolbar() { return ( Quote ); } ``` Quick Start \[#quick-start] A minimal selection toolbar: ```tsx import { SelectionToolbarPrimitive } from "@assistant-ui/react"; Quote ``` `Root` renders a `
` inside a portal, positioned above the text selection. `Quote` renders a ` ``` Relationship to Components \[#relationship-to-components] There is no pre-built shadcn component for SelectionToolbar. See the [Quoting guide](/docs/guides/quoting) for the full workflow including composer quote display and dismiss. API Reference \[#api-reference] For full prop details on every part, see the [SelectionToolbarPrimitive API Reference](/docs/api-reference/primitives/selection-toolbar). Related: * [Quoting Guide](/docs/guides/quoting) * [ComposerPrimitive API Reference](/docs/api-reference/primitives/composer)