|
| 1 | +--- |
| 2 | +title: Migration guide |
| 3 | +--- |
| 4 | + |
| 5 | +# Migration guide for dash-bootstrap-components v1 |
| 6 | + |
| 7 | +_dash-bootstrap-components_ v1 contains loads of new features, but also some breaking changes. This is for two reasons: |
| 8 | + |
| 9 | +- First, now that the library has matured, we have taken the opportunity to clean up the API and make things more consistent across components. |
| 10 | +- Second we have updated all components to support Bootstrap 5 (previously we supported Bootstrap 4). Since Bootstrap 5 also contains a number of breaking changes, we have inherited those in _dash-bootstrap-components_. For more information about the changes in Bootstrap 5, see the upstream [Bootstrap migration guide.](https://v5.getbootstrap.com/docs/5.0/migration) and the [Bootstrap 5 Documentation](https://getbootstrap.com/docs/5.0/layout/grid/). |
| 11 | + |
| 12 | +This guide introduces the new features, and also covers the changes you must make to run your apps with _dash-bootstrap-components_ 1.0.0 rather than 0.13.x (the final v0 releases). If you find any issues not covered here, or bugs in v1 please [raise an issue](https://github.com/facultyai/dash-bootstrap-components/issues/new/choose) on our GitHub repository. |
| 13 | + |
| 14 | +## Dependencies |
| 15 | + |
| 16 | +<span class="badge bg-danger">Breaking</span> _dash-bootstrap-components_ v1 requires Dash 2.0.0 or greater. The primary implication of this is that we have dropped support for Python 2.7 and 3.5. All apps using _dash-bootstrap-components_ v1 should be run with Python 3.6+. |
| 17 | + |
| 18 | +See the [Dash 2.0 migration guide](https://dash.plotly.com/dash-2-0-migration) for more details on changes within Dash itself. |
| 19 | + |
| 20 | +## New Themes |
| 21 | + |
| 22 | +Check out the four new themes: `QUARTZ`, `MORPH`, `VAPOR` and `ZEPHYR` in the [Theme Explorer](/docs/themes/explorer/) |
| 23 | + |
| 24 | +## Icons |
| 25 | + |
| 26 | +Include Bootstrap and Font Awesome icons to your app as easily as adding a Bootstrap Theme using bundled links to CDNs for [Bootstrap Icons](https://icons.getbootstrap.com/) and [Font Awesome](https://fontawesome.com/). See more information in the [Icons](/docs/icons) section of the docs. |
| 27 | + |
| 28 | +## Components |
| 29 | + |
| 30 | +There are six new components in _dash-bootstrap-components_: `Accordion`, `Breadcrumb`, `FormFloating`, `Offcanvas`, `Pagination`, and `Switch`. Additionally many components have changes to their props. |
| 31 | + |
| 32 | +Notably previously there was a mix of `size` and `bs_size` props for controlling the size of some components. All components that allow size to be changed now consistently use `size`. To set the HTML `size` property of the underlying `<input />` in the `Input` component, use `html_size` instead. |
| 33 | + |
| 34 | +### Accordion <span class="badge bg-success">New</span> |
| 35 | +- Added new accordion component. Check out the documentation [here](/docs/components/accordion) |
| 36 | + |
| 37 | +### Badge |
| 38 | +- <span class="badge bg-danger">Breaking</span> The `color` property now only sets the background color. Use the new `text_color` prop to change the color of the text. You’ll likely need to set a dark text color when using `color="light"`. |
| 39 | + |
| 40 | +### Breadcrumb <span class="badge bg-success">New</span> |
| 41 | +- Added new Breadcrumb component. Check out the documentation [here](/docs/components/breadcrumb) |
| 42 | + |
| 43 | +### Buttons |
| 44 | +- <span class="badge bg-danger">Breaking</span> The default color for the buttons is now `primary` rather than `secondary`. This change was made to match the Bootstrap convention. |
| 45 | + |
| 46 | +- <span class="badge bg-danger">Breaking</span> The `block` property has been dropped. Instead, wrap the buttons in a `html.Div` and use the Bootstrap utilities classes such as `"d-grid"` and a `"gap-*"` in the `className` to space the buttons as needed. See [the docs](/docs/components/button) for examples. |
| 47 | + |
| 48 | +- Disabled buttons now have `pointer-events: none` as a default. |
| 49 | + |
| 50 | +### ButtonGroup |
| 51 | +- <span class="badge bg-danger">Breaking</span> The default color for the buttons is now `primary` rather than `secondary`. This change was made to match the Bootstrap convention. |
| 52 | + |
| 53 | +### Card |
| 54 | +- <span class="badge bg-danger">Breaking</span> Dropped `CardDeck` component. Use the Bootstrap grid classes to arrange the cards like a card deck. See |
| 55 | +the [Bootstrap grid docs](https://getbootstrap.com/docs/5.0/layout/grid/#row-columns) for more information. |
| 56 | + |
| 57 | +- <span class="badge bg-danger">Breaking</span> Dropped `CardColumns` component. `CardColumns` had many [issues in Bootstrap 4](https://github.com/twbs/bootstrap/pull/28922) and was dropped in Bootstrap 5. |
| 58 | + |
| 59 | +### Carousel |
| 60 | +- Added `dark` property for dark text, controls, and indicators. This is great for lighter backgrounds. |
| 61 | +- Replaced chevron icons for carousel controls with new SVGs from Bootstrap Icons. |
| 62 | + |
| 63 | +### Collapse |
| 64 | +- <span class="badge bg-danger">Breaking</span> Dropped the `tag` property. |
| 65 | +- Removed the Accordion example since we now have a new Accordion component. |
| 66 | + |
| 67 | +### DropdownMenu |
| 68 | +- <span class="badge bg-danger">Breaking</span> The default color for the buttons is now `primary` rather than `secondary`. This change was made to match the Bootstrap convention. |
| 69 | +- <span class="badge bg-danger">Breaking</span> Changed the `direction` prop options from right and left to start and end to match the Bootstrap 5 convention. |
| 70 | +- <span class="badge bg-danger">Breaking</span> Changed the name of the `right` prop to `align_end`. |
| 71 | +- <span class="badge bg-danger">Breaking</span> Changed the name of the `bs_size` property to `size`. |
| 72 | +- Added `menu_variant` prop to make the dropdown menu a dark color scheme. |
| 73 | + |
| 74 | +### Fade |
| 75 | +- <span class="badge bg-danger">Breaking</span> Dropped `base_class` property. |
| 76 | +- <span class="badge bg-danger">Breaking</span> Dropped `base_class_active` property. |
| 77 | + |
| 78 | +### FormGroup |
| 79 | +- <span class="badge bg-danger">Breaking</span> Dropped `FormGroup`. It is no longer necessary to use `FormGroup` to align components in a form. Use `Row` `Col` and gutter modifier classes and spacing utilities instead. See [the documentation](/docs/components/form) for examples |
| 80 | + |
| 81 | +### FormFloating <span class="badge bg-success">New</span> |
| 82 | +- Added `FormFloating` component to create a label that floats over the form field. See the documentation [here](/docs/components/form) |
| 83 | + |
| 84 | +### Input |
| 85 | +- <span class="badge bg-danger">Breaking</span> Dropped `bs_size` property. Use `size` instead. Use `html_size` to set the HTML size property on the underlying input. |
| 86 | + |
| 87 | +### InputGroup |
| 88 | +- <span class="badge bg-danger">Breaking</span> Dropped `InputGroupAddon` component. It's not necessary to use `InputGroupAddon` because things like `Button` and `InputGroupText` can be added to `InputGroup` as direct children. See the [docs](/docs/components/input_group/) for more examples. |
| 89 | + |
| 90 | +### Jumbotron |
| 91 | +- <span class="badge bg-danger">Breaking</span> Dropped the Jumbotron component. The [docs have an example](/docs/components/jumbotron/) of how to replicate it with Bootstrap utilities. |
| 92 | + |
| 93 | +### Layout |
| 94 | +- <span class="badge bg-danger">Breaking</span> Dropped `no_gutters` prop. Use gutter modifier classes instead. See the [docs](/docs/components/layout/) for examples. |
| 95 | +- <span class="badge bg-danger">Breaking</span> When specifying the `order` of the columns, it accepts the integers 1, ..., 5, only rather than integers 1, ..., 12. |
| 96 | + |
| 97 | +### ListGroup |
| 98 | +- <span class="badge bg-danger">Breaking</span> Dropped the `ListGroupHeading` and `ListGroupItemText` components. Both are unnecessary since you can pass any Dash components to the children of `ListGroupItem`. See the [docs](/docs/components/list_group/) for updated examples. |
| 99 | + |
| 100 | +### Modal |
| 101 | +- Added `fullscreen` property |
| 102 | +- Added `keyboard` property to close modal when escape key is pressed. |
| 103 | + |
| 104 | +### Nav |
| 105 | +- <span class="badge bg-danger">Breaking</span> - Dropped `active` property in `NavItem`. You should only need to set `active` on the child `NavLink` instead. |
| 106 | +- Added `navbar_scroll` property. This enables vertical scrolling within the toggleable contents of the nav when used inside a collapsed `Navbar`. |
| 107 | + |
| 108 | +### Navbar |
| 109 | +- <span class="badge bg-danger">Breaking</span> - Bootstrap navbars now must be constructed with a container. If you're using `NavbarSimple` you don't need to make any changes! If you are using `Navbar` with a custom layout you probably will need to make changes. See the [docs](/docs/components/list_group/) for updated examples. |
| 110 | + |
| 111 | +### Offcanvas <span class="badge bg-success">New</span> |
| 112 | +- Added the new offcanvas component. See the [docs](/docs/components/offcanvas) for more information. |
| 113 | + |
| 114 | +### Pagination <span class="badge bg-success">New</span> |
| 115 | +- Added a new Pagination component. See the [docs](/docs/components/pagination) for more information. |
| 116 | + |
| 117 | +### Progress |
| 118 | +- <span class="badge bg-danger">Breaking</span> Dropped `barClassName` property. Use `className` |
| 119 | +- <span class="badge bg-danger">Breaking</span> Dropped `bar_style` property. Use `style` |
| 120 | +- <span class="badge bg-danger">Breaking</span> Dropped `tag` property. |
| 121 | +- Added a `label` property that should be used instead of `children` to render text on the progress bar. |
| 122 | +- Added a `hide_label` property to hide the label. |
| 123 | + |
| 124 | +### Select |
| 125 | +- <span class="badge bg-danger">Breaking</span> Dropped `bs_size` property. Use `size` instead. |
| 126 | + |
| 127 | +### Switch <span class="badge bg-success">New</span> |
| 128 | +- New `Switch` component. See the documentation [here](/docs/components/input) |
| 129 | + |
| 130 | +### Table |
| 131 | + - <span class="badge bg-danger">Breaking</span> Dropped `tag` property. |
| 132 | + - Added `color` property. |
| 133 | + |
| 134 | +### Tabs |
| 135 | + - <span class="badge bg-danger">Breaking</span> Dropped `card` property. It's no longer necessary to set `card=True` to put tabs in a `Card`. |
| 136 | + |
| 137 | +### TextArea |
| 138 | +- <span class="badge bg-danger">Breaking</span> Dropped `bs_size` property. Use `size` instead. |
| 139 | + |
| 140 | +### Toast |
| 141 | +- <span class="badge bg-danger">Breaking</span> Dropped `fade` property. |
| 142 | +- Added `color` property to set the background color. |
| 143 | + |
| 144 | +### Tooltip |
| 145 | +- <span class="badge bg-danger">Breaking</span> Dropped the following properties: `arrowClassName`, `autohide`, `boundaries_element`, `container`, `hide_arrow`, `innerClassName`, `offset` |
0 commit comments