# Bootstrap Svelte — full documentation > Every page of https://bootstrap-svelte.vercel.app as Markdown (@winkintel/bootstrap-svelte 2.1.0). Index with one-line summaries: https://bootstrap-svelte.vercel.app/llms.txt. --- # Bootstrap 5 components for Svelte 5 Source: https://bootstrap-svelte.vercel.app/ — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). Svelte 5 · Bootstrap 5 · TypeScript `@winkintel/bootstrap-svelte` provides Bootstrap 5 components for Svelte 5 and SvelteKit with TypeScript-friendly, runes-ready APIs. Add Bootstrap CSS in your app; Bootstrap JavaScript is not required. - [Browse components](https://bootstrap-svelte.vercel.app/components/accordion) - [Install package](https://bootstrap-svelte.vercel.app/#installation) - [npm](https://www.npmjs.com/package/@winkintel/bootstrap-svelte) - [GitHub](https://github.com/WinkIntel/bootstrap-svelte) ## Installation Add the package with Bootstrap. Svelte `^5.29.0` is a peer dependency, so keep your app on Svelte 5 separately from the package install command. ### 1 Install ```bash pnpm add @winkintel/bootstrap-svelte bootstrap ``` Peer dependency: `svelte: ^5.29.0` ### 2 Use ```html Ship Bootstrap-native interfaces with Svelte 5. ``` ## Everything in the box Every route ships live examples, usage snippets, an interactive playground, and API notes. ### Guides - [Theming](https://bootstrap-svelte.vercel.app/theming) - [SvelteKit + Bootstrap 5](https://bootstrap-svelte.vercel.app/guides/sveltekit-bootstrap-5) - [Bootstrap Svelte vs Sveltestrap](https://bootstrap-svelte.vercel.app/guides/compare-sveltestrap) ### Layout - [Breakpoint](https://bootstrap-svelte.vercel.app/layout/breakpoint) - [Container](https://bootstrap-svelte.vercel.app/layout/container) - [Grid](https://bootstrap-svelte.vercel.app/layout/grid) - [Columns](https://bootstrap-svelte.vercel.app/layout/columns) ### Components - [Accordion](https://bootstrap-svelte.vercel.app/components/accordion) - [Alert](https://bootstrap-svelte.vercel.app/components/alert) - [Badge](https://bootstrap-svelte.vercel.app/components/badge) - [Breadcrumb](https://bootstrap-svelte.vercel.app/components/breadcrumb) - [Button](https://bootstrap-svelte.vercel.app/components/button) - [Button Group](https://bootstrap-svelte.vercel.app/components/button-group) - [Card](https://bootstrap-svelte.vercel.app/components/card) - [Carousel](https://bootstrap-svelte.vercel.app/components/carousel) - [Close Button](https://bootstrap-svelte.vercel.app/components/close-button) - [Collapse](https://bootstrap-svelte.vercel.app/components/collapse) - [Dropdown](https://bootstrap-svelte.vercel.app/components/dropdown) - [List Group](https://bootstrap-svelte.vercel.app/components/list-group) - [Modal](https://bootstrap-svelte.vercel.app/components/modal) - [Nav](https://bootstrap-svelte.vercel.app/components/nav) - [Navbar](https://bootstrap-svelte.vercel.app/components/navbar) - [Offcanvas](https://bootstrap-svelte.vercel.app/components/offcanvas) - [Pagination](https://bootstrap-svelte.vercel.app/components/pagination) - [Placeholder](https://bootstrap-svelte.vercel.app/components/placeholder) - [Popover](https://bootstrap-svelte.vercel.app/components/popover) - [Progress](https://bootstrap-svelte.vercel.app/components/progress) - [Scrollspy](https://bootstrap-svelte.vercel.app/components/scrollspy) - [Spinner](https://bootstrap-svelte.vercel.app/components/spinner) - [Tab](https://bootstrap-svelte.vercel.app/components/tab) - [Table](https://bootstrap-svelte.vercel.app/components/table) - [Toast](https://bootstrap-svelte.vercel.app/components/toast) - [Tooltip](https://bootstrap-svelte.vercel.app/components/tooltip) ### Form - [Form Controls](https://bootstrap-svelte.vercel.app/form/form-controls) - [Form Input Group](https://bootstrap-svelte.vercel.app/form/form-input-group) - [Form Layout](https://bootstrap-svelte.vercel.app/form/form-layout) - [Form Validation](https://bootstrap-svelte.vercel.app/form/form-validation) ## Design principles The showcase is structured to make public package review fast: installation first, examples second, and API details close by. ### Bootstrap-compatible Component props and generated markup are designed to stay close to Bootstrap conventions. ### Svelte-native Use Svelte 5 components, snippets, bindings, and TypeScript-friendly public APIs. ## What to review Review the license, npm package metadata, component API consistency, accessibility notes, and showcase visual direction. [Open first component](https://bootstrap-svelte.vercel.app/components/accordion) --- # Theming > Bootstrap Svelte follows Bootstrap's design tokens instead of shipping a separate theme layer. Source: https://bootstrap-svelte.vercel.app/theming — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Bootstrap CSS Consumers must include Bootstrap CSS once in their application. The components emit Bootstrap-compatible classes and markup. ```html import 'bootstrap/dist/css/bootstrap.min.css'; ``` ## SCSS Variables Override Bootstrap Sass variables before importing Bootstrap if your build pipeline compiles SCSS. ```scss // app.scss $primary: #563d7c; $border-radius: .5rem; @import 'bootstrap/scss/bootstrap'; ``` ## CSS Variables and Color Modes Bootstrap 5.3 exposes runtime CSS variables and supports `data-bs-theme`. Use those primitives for light, dark, or scoped theme regions. ```html
``` ## Contrast Responsibilities Some Bootstrap utility combinations, especially outline warning, outline info, and outline light on white backgrounds, can miss WCAG AA text contrast before hover or active states. Prefer contrast-safe combinations in production, or override the relevant Bootstrap CSS variables for the preview surface. --- # Use Bootstrap 5 with SvelteKit and Svelte 5 > Add `@winkintel/bootstrap-svelte` to a SvelteKit app with Svelte 5, TypeScript/runes APIs, and Bootstrap 5 CSS while leaving Bootstrap JavaScript out of the bundle. Source: https://bootstrap-svelte.vercel.app/guides/sveltekit-bootstrap-5 — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Install Install Bootstrap Svelte and Bootstrap together. Svelte `^5.29.0` is a peer dependency supplied by your SvelteKit app. ```bash pnpm add @winkintel/bootstrap-svelte bootstrap ``` ## Add Bootstrap CSS Bootstrap CSS is required because the components render Bootstrap-compatible classes and markup. Import it once from the root layout or your app stylesheet pipeline. ```html // src/routes/+layout.ts import 'bootstrap/dist/css/bootstrap.min.css'; export const prerender = true; ``` If your SvelteKit project already compiles Sass, import Bootstrap SCSS instead. ```html // src/app.scss @import 'bootstrap/scss/bootstrap'; // src/routes/+layout.ts import '../app.scss'; ``` ## SSR and Hydration The package components are Svelte components that render during SSR and hydrate in the browser. Do not load Bootstrap's JavaScript bundle or individual Bootstrap plugins for the same controls; Bootstrap Svelte owns the component behavior. - Keep DOM-only work in Svelte lifecycle code such as `onMount`. - Use component state, for example `$state(false)`, to control modals, collapses, and offcanvas panels. - Import Bootstrap CSS once so server-rendered HTML and hydrated HTML use the same class styling. ## Button Example Use [Button](https://bootstrap-svelte.vercel.app/components/button) for typed Bootstrap button variants, sizes, links, and events. ```html ``` ## Navbar Example Use [Navbar](https://bootstrap-svelte.vercel.app/components/navbar) with [Nav](https://bootstrap-svelte.vercel.app/components/nav) and [Container](https://bootstrap-svelte.vercel.app/layout/container). ```html Acme Home Settings ``` ## Form Example Use [form controls](https://bootstrap-svelte.vercel.app/form/form-controls) with Svelte bindings and Bootstrap validation classes. ```html
Email address Use a work email address.
I accept the terms
``` ## Modal Example Use [Modal](https://bootstrap-svelte.vercel.app/components/modal) state instead of Bootstrap JavaScript data attributes. ```html (isModalShown = false)}> Confirm action

Review the details before continuing.

``` --- # Bootstrap Svelte vs Sveltestrap for Svelte 5 > Both projects provide Bootstrap 5 components for Svelte. The practical difference is whether you want a Svelte 5-first, TypeScript-authored API or a library that also supports Svelte 4 and keeps a classic Svelte component style. Source: https://bootstrap-svelte.vercel.app/guides/compare-sveltestrap — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). Primary-source review completed August 26, 2026. Recheck package contracts before a migration. --- ## Quick Comparison | Decision point | Bootstrap Svelte | Sveltestrap | | --- | --- | --- | | Svelte support | Svelte `^5.29.0`; designed as a Svelte 5 library. | Svelte 4, Svelte 5, and the Svelte 5 prerelease range declared by its package. | | API and typing | TypeScript-authored components, Svelte 5 runes, and composable namespaces such as `Modal.Root`. | Classic Svelte component APIs with flat exports and distributed declaration files. | | Bootstrap assets | Install Bootstrap separately and import Bootstrap CSS or SCSS. Do not add Bootstrap JavaScript plugins. | Add Bootstrap CSS separately. Its README says Bootstrap JavaScript and jQuery are not required. | | Component shape | Focused Bootstrap 5 layout, form, and component families with compound subcomponents. | A broad Reactstrap-style inventory with granular exports, including additional utility components. | | SSR and testing evidence | Uses browser lifecycle guards and includes unit, interaction, accessibility, and targeted server-rendering tests. | Includes unit and SvelteKit integration fixtures; browser-only portal work is deferred to `onMount`. | ## Which Should You Choose? - Choose **Bootstrap Svelte** for a Svelte 5-first codebase that values TypeScript-authored APIs, runes, compound component namespaces, and package documentation available as HTML and Markdown. - Choose **Sveltestrap** when Svelte 4 compatibility, an existing Sveltestrap integration, or its classic flat component API is the stronger constraint. - For overlays, portals, or a large migration, smoke-test SSR and hydration in your own SvelteKit deployment before committing. ## Primary Sources - Bootstrap Svelte: [package contract](https://github.com/WinkIntel/bootstrap-svelte/blob/main/package.json), [installation and API guidance](https://github.com/WinkIntel/bootstrap-svelte/blob/main/README.md), and [component source and tests](https://github.com/WinkIntel/bootstrap-svelte/tree/main/src/lib). - Sveltestrap: [package contract](https://github.com/sveltestrap/sveltestrap/blob/main/package.json), [installation guidance](https://github.com/sveltestrap/sveltestrap/blob/main/README.md), [component source](https://github.com/sveltestrap/sveltestrap/tree/main/src), and [Storybook documentation](https://sveltestrap.js.org/). --- # Breakpoint > Breakpoints are customizable widths that determine how your responsive layout behaves across device or viewport sizes in Bootstrap. Source: https://bootstrap-svelte.vercel.app/layout/breakpoint — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). The following examples replicate each of the examples from the Bootstrap documentation: [https://getbootstrap.com/docs/5.3/layout/breakpoints/](https://getbootstrap.com/docs/5.3/layout/breakpoints/) --- ## Bindable Example ```html

The current breakpoint is: {currentBreakpoint != null ? BreakpointEnum[currentBreakpoint] : 'undefined'}

``` ## Render On Single Breakpoint Example ```html

👋🏼😁 Hello Medium Screens

``` ## Render On Multiple Breakpoint Example ```html

👋🏼😁 Hello Medium and Large Screens

``` ## OnChange Callback Example ```html { onChangeCurrentBreakpoint = changeEvent.current; onChangePreviousBreakpoint = changeEvent.previous; }} />

The current breakpoint is: {onChangeCurrentBreakpoint != null ? BreakpointEnum[onChangeCurrentBreakpoint] : 'undefined'}

The previous breakpoint is: {onChangePreviousBreakpoint != null ? BreakpointEnum[onChangePreviousBreakpoint] : 'undefined'}

``` ## OnBreakUp Callback Example ```html { onBreakUpFromBreakpoint = breakEvent.from; onBreakUpToBreakpoint = breakEvent.to; }} />

The breakpoint broke up from {onBreakUpFromBreakpoint != null ? BreakpointEnum[onBreakUpFromBreakpoint] : 'undefined'}

The breakpoint broke up to: {onBreakUpToBreakpoint != null ? BreakpointEnum[onBreakUpToBreakpoint] : 'undefined'}

``` ## OnBreakDown Callback Example ```html { onBreakDownFromBreakpoint = breakEvent.from; onBreakDownToBreakpoint = breakEvent.to; }} />

The breakpoint broke down from {onBreakDownFromBreakpoint != null ? BreakpointEnum[onBreakDownFromBreakpoint] : 'undefined'}

The breakpoint broke down to: {onBreakDownToBreakpoint != null ? BreakpointEnum[onBreakDownToBreakpoint] : 'undefined'}

``` ## API Reference ### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `currentBreakpoint` | `BreakpointEnum \| undefined` | `undefined` | Reference to the current breakpoint | | `isDisabled` | `boolean` | `false` | Disables the breakpoint monitor if set to true. | | `renderOn` | `BreakpointEnum \| BreakpointEnum[] \| undefined` | `undefined` | Controls whether the children are rendered based on the current breakpoint. | ### Events | Name | Type | Description | | --- | --- | --- | | `onChange` | `(changeEvent: ChangeEvent) => void` | Fired when the breakpoint changes. | | `onBreakUp` | `(breakEvent: BreakEvent) => void;` | Fired when the breakpoint is about to change to a larger size (at the start of the transition). | | `onBreakDown` | `(breakEvent: BreakEvent) => void;` | Fired when the breakpoint is about to change to a smaller size (at the start of the transition). | --- # Container > Bootstrap's basic container component built with Svelte 5. Containers are used to contain, pad, and center content within a given viewport. Source: https://bootstrap-svelte.vercel.app/layout/container — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Basic Example Containers are the most basic layout element in Bootstrap and are required when using the grid system. Choose from a responsive fixed-width container or a fluid-width container. ```html

This is content inside the default container.

``` ## Fluid Container Use `isFluid={true}` to create a full-width container that spans the entire width of the viewport. ```html

This container is fluid and spans the full width of the viewport.

``` ## Responsive Containers Responsive containers allow you to specify a container that is 100% wide until a specified breakpoint is reached, after which a max-width is applied for each of the higher breakpoints. Use the `breakpoint` prop to set the breakpoint. ```html ``` ## Container with Grid Containers are the foundation of Bootstrap's grid system. Here's an example of using a container with Bootstrap's grid system: ```html
col-sm-8
col-sm-4
col-sm
col-sm
col-sm
``` ## API Reference ### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `breakpoint` | `string` | `undefined` | Sets the breakpoint at which the container becomes responsive. Values: 'sm', 'md', 'lg', 'xl', 'xxl'. When undefined, uses the default 'container' class. | | `class` | `string` | `undefined` | Additional CSS classes to apply to the component. | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `isFluid` | `boolean` | `false` | Makes the container full-width spanning the entire viewport width | ### CSS Classes The component applies Bootstrap's container classes based on the provided props: - `container` - Applied when breakpoint is not provided and isFluid is false - `container-fluid` - Applied when isFluid is true - `container-{breakpoint}` - Applied based on the breakpoint prop (sm, md, lg, xl, xxl) --- # Grid > Use the powerful mobile-first flexbox grid to build layouts of all shapes and sizes thanks to a twelve column system, six default responsive tiers, Sass variables and mixins, and dozens of predefined classes. Source: https://bootstrap-svelte.vercel.app/layout/grid — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). The following examples replicate each of the examples from the Bootstrap documentation: [https://getbootstrap.com/docs/5.3/layout/grid/](https://getbootstrap.com/docs/5.3/layout/grid/) --- ## Basic Example ```html Column Column Column ``` ## Equal-width ```html 1 of 2 2 of 2 1 of 3 2 of 3 3 of 3 ``` ## Setting one column width ```html 1 of 3 2 of 3 (wider) 3 of 3 1 of 3 2 of 3 (wider) 3 of 3 ``` ## Variable width content ```html 1 of 3 Variable width content 3 of 3 1 of 3 Variable width content 3 of 3 ``` ## All breakpoints ```html col col col col col-8 col-4 ``` ## Stacked to horizontal ```html col-sm-8 col-sm-4 col-sm col-sm col-sm ``` ## Mix and match ```html col-md-8 col-6 .col-md-4 col-6 .col-md-4 col-6 .col-md-4 col-6 .col-md-4 col-6 col-6 ``` ## Row columns ```html Column Column Column Column ``` ```html Column Column Column Column ``` ```html Column Column Column Column ``` ```html Column Column Column Column ``` ```html Column Column Column Column ``` ```html Column Column Column Column ``` ## Nesting ```html Level 1: .col-sm-3 Level 2: .col-8 .col-sm-6 Level 2: .col-4 .col-sm-6 ``` --- # Columns > Learn how to modify columns with a handful of options for alignment, ordering, and offsetting thanks to our flexbox grid system. Plus, see how to use column classes to manage widths of non-grid elements. Source: https://bootstrap-svelte.vercel.app/layout/columns — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). The following examples replicate each of the examples from the Bootstrap documentation: [https://getbootstrap.com/docs/5.3/layout/columns/](https://getbootstrap.com/docs/5.3/layout/columns/) --- ## Vertical alignment ```html One of three columns One of three columns One of three columns ``` ```html One of three columns One of three columns One of three columns ``` ```html One of three columns One of three columns One of three columns ``` ```html One of three columns One of three columns One of three columns ``` ## Horizontal alignment ```html One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns ``` ## Column wrapping ```html .col-9 .col-4
Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit. .col-6
Subsequent columns continue along the new line.
``` ## Column breaks ```html .col-6 .col-sm-3 .col-6 .col-sm-3
.col-6 .col-sm-3 .col-6 .col-sm-3
``` ```html .col-6 .col-sm-4 .col-6 .col-sm-4
.col-6 .col-sm-4 .col-6 .col-sm-4
``` ## Order classes ```html First in DOM, no order applied Second in DOM, with a larger order Third in DOM, with an order of 1 ``` ```html First in DOM, ordered last Second in DOM, unordered Third in DOM, ordered first ``` ## Offset classes ```html .col-md-4 .col-md-4 .offset-md-4 .col-md-3 .offset-md-3 .col-md-3 .offset-md-3 .col-md-6 .offset-md-3 ``` ```html .col-sm-5 .col-md-6 .col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0 .col-sm-6 .col-md-5 .col-lg-6 .col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0 ``` ## Margin utilities ```html .col-md-4 .col-md-4 .ms-auto .col-md-3 .ms-md-auto .col-md-3 .ms-md-auto .col-auto .me-auto .col-auto ``` ## Standalone column classes ```html .col-3: width of 25% .col-sm-9: width of 75% above sm breakpoint ``` --- # Accordion > Bootstrap's accordion component built with Svelte 5. Use the accordion component to build vertically collapsing accordions. Source: https://bootstrap-svelte.vercel.app/components/accordion — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Basic Example The basic accordion includes several items that can be expanded and collapsed independently. By default, only one item can be open at a time. ```html Accordion Item #1 This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. You can modify any of this with custom CSS or overriding our default variables. Accordion Item #2 This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. ``` ## Always Open Set the `isMultiple` prop to `true` to make accordion items stay open when another item is opened. ```html Accordion Item #1 This is the first item's accordion body. It can remain open when another item is opened, because the isMultiple prop is set to true. Accordion Item #2 This is the second item's accordion body. It can stay open when other items are opened. ``` ## Flush Add the `isFlush` prop to remove the default background color, some borders, and rounded corners. ```html Accordion Item #1 This is the first item's accordion body. Notice there is no border or background. This is a flush accordion. Accordion Item #2 This is the second item's accordion body. The flush accordion removes borders and background. ``` ## Custom Styling You can style the accordion using Bootstrap's utility classes to create custom themes. ```html
Dark Theme Item #1 This is styled with dark theme classes. You can customize the appearance using standard Bootstrap classes. Dark Theme Item #2 This is the second dark-themed item. Custom styling can be applied to create various visual effects.
``` ## API Reference The Accordion component is composed of several sub-components: ### Accordion.Root The main accordion container component #### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `undefined` | Additional CSS classes to apply | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `isMultiple` | `boolean` | `false` | Allows multiple items to be open simultaneously | | `isFlush` | `boolean` | `false` | Removes borders and background from the accordion | | `id` | `string` | `auto-generated` | Unique ID for the collapse element | ### Accordion.Item Container for an individual accordion item #### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `undefined` | Additional CSS classes to apply | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `isExpanded` | `boolean` | `false` | Controls whether the item is initially expanded | | `id` | `string` | `auto-generated` | Unique ID for the collapse element | ### Accordion.Header The heading container for the accordion item #### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `undefined` | Additional CSS classes to apply | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `id` | `string` | `auto-generated` | Unique ID for the collapse element | ### Accordion.Button The clickable button that toggles the accordion item #### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `undefined` | Additional CSS classes to apply | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `id` | `string` | `auto-generated` | Unique ID for the collapse element | ### Accordion.Collapse The collapsible container that wraps the accordion body #### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `undefined` | Additional CSS classes to apply | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `id` | `string` | `auto-generated` | Unique ID for the collapse element | ### Accordion.Body The content container for the accordion item #### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `undefined` | Additional CSS classes to apply | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `id` | `string` | `auto-generated` | Unique ID for the collapse element | ### CSS Classes The components apply Bootstrap's accordion classes based on the provided props: - `accordion` - Base class for the Root component - `accordion-flush` - Applied to Root when isFlush is true - `accordion-item` - Base class for the Item component - `accordion-header` - Base class for the Header component - `accordion-button` - Base class for the Button component - `accordion-collapse` - Base class for the Collapse component - `accordion-body` - Base class for the Body component - `collapsed` - Applied to Button when the corresponding item is not expanded - `show` - Applied to Collapse when the corresponding item is expanded --- # Alert > Bootstrap's alert component built with Svelte 5. Use alerts to provide contextual feedback messages for typical user actions. Source: https://bootstrap-svelte.vercel.app/components/alert — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Basic Example ```html A simple primary alert—check it out! ``` ## Alert Variants Bootstrap includes several predefined alert styles for different contexts. ```html A simple primary alert—check it out! A simple secondary alert—check it out! A simple success alert—check it out! A simple danger alert—check it out! A simple warning alert—check it out! A simple info alert—check it out! A simple light alert—check it out! A simple dark alert—check it out! ``` ## Dismissible Alerts Make alerts dismissible by adding the `isDismissible` prop. This adds a close button to the alert and allows it to be closed by users. ```html Holy guacamole! You should check in on some of those fields below. ``` ## Additional Content Alerts can contain additional HTML elements like headings, paragraphs and dividers. ```html

Well done!

Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.


Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

``` ## Icons Add icons to your alerts to enhance visual appearance. You can use any icon library like Bootstrap Icons. ```html An example alert with an icon ``` ## API Reference ### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `colorVariant` | `string` | `'primary'` | Sets the alert's background color. Values: 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark'. | | `isDismissible` | `boolean` | `false` | Adds a close button that allows users to dismiss the alert. | | `isAnimated` | `boolean` | `true` | Enables the fade animation when the alert is shown or hidden. | | `isOpen` | `boolean` | `true` | Controls the visibility of the alert. Can be bound using `bind:isOpen`. | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | ### Events | Name | Type | Description | | --- | --- | --- | | `onClose` | `EventListener` | Fired when the alert is about to Close (at the start of the transition). | | `onClosed` | `EventListener` | Fired when the alert has been fully Closed (after the transition is complete). | ### CSS Classes The component applies Bootstrap's alert classes based on the provided props: - `alert` - Always applied as the base class - `{variant}` - Applied based on the variant prop - `alert-dismissible` - Applied when isDismissible is true - `fade` - Applied when isAnimated is true - `show` - Applied when isOpen is true and isAnimated is true --- # Badge > Bootstrap's badge component built with Svelte 5. Use badges to highlight elements, add counts, or display status. Source: https://bootstrap-svelte.vercel.app/components/badge — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Basic Example ```html Base badge ``` ## Badge Variants Bootstrap includes several predefined badge styles with contextual colors. ```html Primary Secondary Success Danger Warning Info Light Dark ``` ## Badges with Headings Badges can be used with any heading (h1-h6) to add supplemental information or status indicators. ```html

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New
``` ## Button with Badge Badges can be embedded inside buttons to show counts or status indicators alongside button text. ```html ``` ## Pill Badges Create badge with more rounded corners using the `isPill` prop. ```html Primary Secondary Success Danger Warning Info Light Dark ``` ## Subtle Badges Use subtle badges with lighter backgrounds with the `subtle` variants. ```html Subtle Subtle Subtle Subtle Subtle Subtle Subtle ``` ## Positioned Badges Use the `position` prop to place badges in the corner of elements. ```html ``` ## API Reference ### Props | Name | Type | Default | Description | | --- | --- | --- | --- | | `class` | `string` | `text-bg-primary` | Additional CSS classes to apply to the component. | | `elementRef` | `HTMLElement \| null` | `null` | Reference to the DOM element | | `isPill` | `boolean` | `false` | Makes the badge more rounded (pill shaped) | | `position` | `string` | — | Used for positioning the badge. Values: 'positioned', 'positioned-top', 'positioned-end', 'positioned-bottom', 'positioned-start' | | `colorVariant` | `string` | `'text-bg-primary'` | Sets the badge's background color. Values: 'text-bg-primary', 'text-bg-secondary', 'text-bg-success', 'text-bg-danger', 'text-bg-warning', 'text-bg-info', 'text-bg-light', 'text-bg-dark', or *-subtle variants. | ### CSS Classes The component applies Bootstrap's badge classes based on the provided props: - `badge` - Always applied as the base class - `{variant}` - Applied based on the variant prop - `rounded-pill` - Applied when pill is true - `position-absolute top-{0|50|100} start-{0|50|100} translate-middle` - Applied based on the position prop --- # Breadcrumb > Indicate the current page's location within a navigational hierarchy that automatically adds separators via CSS. Source: https://bootstrap-svelte.vercel.app/components/breadcrumb — part of the Bootstrap Svelte documentation (index: https://bootstrap-svelte.vercel.app/llms.txt). ## Basic Example Use a breadcrumb to indicate the hierarchical navigation structure for the current page. Breadcrumbs automatically add visual separators via CSS, with the active item (usually the current page) being visually distinct and non-linkable. ```html Home Library Data ``` ## Custom Dividers Breadcrumb dividers are created using CSS through the `::before` pseudo-element and `content` property. You can modify the divider by changing the `divider` prop, which sets the CSS custom property `--bs-breadcrumb-divider`. You can use a string character like `>` or even an SVG embedded as a data URI. ```html Home Library Data Home Library Data ``` ## No Divider You can also remove the divider by setting `divider=""` (an empty string). ```html Home Library Data ``` ## Accessibility Since breadcrumbs provide a navigation, it's good practice to add a meaningful label such as `ariaLabel="breadcrumb navigation"` to describe the type of navigation provided in the `