Migrating from Bootstrap to Lily

A component-by-component migration plan. Lily is not a class-name compatibility layer: preserve semantics and behaviour while moving visual decisions into a theme or product stylesheet.

Before converting markup

  • Lily's headless packages ship no CSS. Choose a reference theme or provide your own styles.
  • Lily has no spacing, colour, display, breakpoint, or layout utility classes.
  • Visible text is content or a prop supplied by your application; Lily does not build English labels.
  • Use the library for your framework and follow the shared component contract.

Component and class mapping

This table is generated from the canonical mapping. Every Lily slug is checked against the component catalog during bin/test.

Bootstrap component or classLily componentWhat changes
Accordion (.accordion)accordion-list, accordion-list-itemUse the list and item composition; Lily owns disclosure semantics and keyboard behaviour, while a theme supplies appearance.
Alerts (.alert)alertPass the message as content and the semantic type as data or a component prop; do not carry Bootstrap colour classes across.
Badges (.badge)badgeUse text that communicates the status without colour; Lily does not provide `bg-*` utility classes.
Breadcrumb (.breadcrumb)breadcrumb-nav, breadcrumb-list, breadcrumb-list-item, breadcrumb-linkUse the complete navigation/list family so the landmark, current page, and separators remain semantic.
Buttons (.btn, .btn-*)buttonUse the component for element and disabled semantics; choose a theme or target `.button` instead of copying variant utility classes.
Button group (.btn-group)button-groupKeep each action as a real button and provide an accessible group label where the actions form one set.
Cards (.card)cardCard is structural and unstyled; compose headings, links, and actions as content rather than translating `.card-*` classes one by one.
Carousel (.carousel)carouselLily supplies the carousel contract and keyboard behaviour; labels and autoplay policy stay under product control.
Collapse (.collapse)collapsibleLily uses native disclosure semantics. Connect the visible trigger and region rather than toggling a presentation class.
Dropdowns (.dropdown)dropdown-menu, menu, menu-itemChoose menu semantics only for a set of actions. A navigation list or select is not a menu merely because it opens.
List group (.list-group)collection-list, collection-list-itemUse a semantic collection. Links and buttons inside items keep their native roles instead of making every row interactive.
Modal (.modal)dialogLily uses the native dialog element and supplies focus management; open it through the catalog API rather than toggling display classes.
Navbar (.navbar)navigation-menuUse a labelled navigation landmark and real links. Responsive layout and branding belong to your stylesheet or chosen theme.
Tabs (.nav-tabs)tab-bar, tab-bar-button, tab-panelUse the whole tabs family so selection, focus, arrow keys, and panel relationships remain synchronized.
Offcanvas (.offcanvas)drawerUse a modal drawer when background interaction must stop; use ordinary layout for persistent side navigation.
Pagination (.pagination)pagination-nav, pagination-list, pagination-list-item, pagination-linkUse the family and mark the current page in words and with `aria-current`; disabled links are not a native state.
Placeholders (.placeholder)skeletonTreat loading placeholders as temporary content and preserve an accessible loading announcement outside decorative shapes.
Popovers (.popover)popoverUse the Popover API contract and an explicit trigger relationship; Lily does not infer behaviour from a class.
Progress (.progress)progressProvide an accessible name and a numeric value when progress is determinate; omit the value for indeterminate work.
Scrollspy (data-bs-spy="scroll")contents-navUse a contents navigation and add observation behaviour separately; the navigation remains useful when scripting is unavailable.
Spinners (.spinner-border, .spinner-grow)progress-spinnerSupply adjacent status text or an accessible name. Animation alone must not communicate that work is happening.
Toasts (.toast)toastChoose the live-region urgency deliberately, keep messages available long enough, and put persistent actions elsewhere.
Tooltips (.tooltip)tooltipTooltips supplement a visible label; they must work with keyboard focus and pointer hover and must not contain required information.
Form controls (.form-control, .form-select)text-input, text-area-input, selectChoose the component that matches the native control. Labels, hints, and errors are separate content, not placeholder text.
Checks (.form-check)checkbox-input, radio-inputKeep native checkbox or radio semantics and group radios with a fieldset and legend when they answer one question.
Input groups (.input-group)input-groupKeep one accessible control name; visible prefixes and suffixes need not be repeated in that name when they are decorative.
Floating labels (.form-floating)field, label, hint, error-messageLily has no floating-label primitive. Compose a persistent visible label, optional hint, control, and linked error message.
Tables (.table)tableUse native table structure and header cells. Responsive overflow is a wrapper concern and must not destroy the table semantics.
Layout (.container, .row, .col-*)container, gridUse semantic containers plus your own responsive CSS; Lily intentionally has no spacing, breakpoint, or column utility vocabulary.

Worked conversion: sign-in card

Bootstrap markup commonly combines component and visual utility classes:

<div class="card shadow-sm p-3">
  <div class="card-body">
    <h1 class="h4">Sign in</h1>
    <div class="mb-3">
      <label class="form-label" for="email">Email</label>
      <input class="form-control" id="email" name="email" type="email" required />
    </div>
    <button class="btn btn-primary w-100" type="submit">Continue</button>
  </div>
</div>

In Lily the card stays a div.card, the field and its button sit in a form named by the heading, and the visual utilities become product CSS:

<div class="card sign-in-card">
  <h1 id="sign-in-title">Sign in</h1>
  <form class="form" aria-labelledby="sign-in-title" method="post">
    <div class="field">
      <label class="label" for="email">Email</label>
      <p class="hint" id="email-hint">Use the address your account was registered with.</p>
      <input class="text-input" id="email" name="email" type="email"
        autocomplete="email" aria-describedby="email-hint" required />
    </div>
    <button class="button sign-in-card-submit" type="submit">Continue</button>
  </form>
</div>

The product stylesheet owns spacing and width. A Lily theme can provide the baseline appearance without becoming a headless-library dependency.

Accessibility gains to preserve

  • Target components fix the semantic element, accessible relationships, and keyboard interaction.
  • Dialogs, tabs, menus, carousels, and disclosures have explicit focus and keyboard contracts.
  • Forms keep visible labels and connect hints and translated errors with aria-describedby.
  • Lily has not been independently audited; test with assistive technology and supported browsers.

Migration order

  1. Inventory Bootstrap component, data-bs-*, and utility classes.
  2. Replace interactive components first and test focus and keyboard behaviour.
  3. Choose a theme or introduce product CSS for layout and visual utilities.
  4. Replace forms as complete field compositions, including hints and errors.
  5. Remove Bootstrap JavaScript and CSS only after no Bootstrap behaviour or utility remains.

Read the repository guide