|
| 1 | +--- |
| 2 | +"flowbite-react": minor |
| 3 | +--- |
| 4 | + |
| 5 | +## Summary |
| 6 | + |
| 7 | +This release brings massive improvements to Flowbite React's capabilities, introducing the first automatic Tailwind CSS class generation system and native support for both Tailwind CSS v3 and v4. Key highlights include: |
| 8 | + |
| 9 | +- **Automatic Class Generation**: First UI library to automatically detect and generate Tailwind CSS classes |
| 10 | +- **Tailwind CSS v4 Support**: Native compatibility with both Tailwind CSS v3 and v4 |
| 11 | +- **Comprehensive Prefix Support**: Complete system for customizing class prefixes |
| 12 | +- **Enhanced CLI Tools**: New project initialization and component creation commands |
| 13 | +- **Expanded Framework Support**: 15 new framework integration guides and templates |
| 14 | + |
| 15 | +## New Engine |
| 16 | + |
| 17 | +### Automatic Class Generation |
| 18 | + |
| 19 | +- First UI library to implement automatic Tailwind CSS class detection |
| 20 | +- Only includes styles for components you actually import and use |
| 21 | +- Works like tree-shaking but for Tailwind CSS classes |
| 22 | +- Real-time class list updates during development |
| 23 | +- Optimized production builds with minimal CSS output |
| 24 | + |
| 25 | +Learn more about class generation in our [CLI documentation](https://flowbite-react.com/docs/getting-started/cli#cli-commands). |
| 26 | + |
| 27 | +### One-Command Setup |
| 28 | + |
| 29 | +```bash |
| 30 | +npx flowbite-react@latest init |
| 31 | +``` |
| 32 | + |
| 33 | +This single command: |
| 34 | + |
| 35 | +- Detects your project's environment |
| 36 | +- Installs necessary dependencies |
| 37 | +- Configures Tailwind CSS |
| 38 | +- Sets up the appropriate bundler plugin |
| 39 | +- Creates optimal VSCode configuration |
| 40 | +- Initializes the `.flowbite-react` directory |
| 41 | + |
| 42 | +See our [quickstart guide](https://flowbite-react.com/docs/getting-started/quickstart) for detailed setup instructions. |
| 43 | + |
| 44 | +### Smart Version Handling |
| 45 | + |
| 46 | +- Automatic detection of Tailwind CSS version (v3 or v4) |
| 47 | +- No manual configuration needed |
| 48 | +- Adapts class generation to version-specific syntax |
| 49 | +- Ensures compatibility with both versions simultaneously |
| 50 | + |
| 51 | +Read more about version compatibility in our [compatibility guide](https://flowbite-react.com/docs/getting-started/compatibility). |
| 52 | + |
| 53 | +## Major Features |
| 54 | + |
| 55 | +### 1. Enhanced Integration Support |
| 56 | + |
| 57 | +- Added new framework integration guides and templates: |
| 58 | + - Blitz.js |
| 59 | + - Bun |
| 60 | + - ESBuild |
| 61 | + - Farm |
| 62 | + - Meteor.js |
| 63 | + - Modern.js |
| 64 | + - React Router |
| 65 | + - React Server |
| 66 | + - Rsbuild |
| 67 | + - Rspack |
| 68 | + - TanStack Router |
| 69 | + - TanStack Start |
| 70 | + - Vike |
| 71 | + - Waku |
| 72 | + - Webpack |
| 73 | + |
| 74 | +Explore all integration guides in our [framework guides section](https://flowbite-react.com/docs/guides). |
| 75 | + |
| 76 | +### 2. Prefix Support System |
| 77 | + |
| 78 | +- Added support for customizing Tailwind CSS class prefixes |
| 79 | +- Different configuration options for Tailwind CSS v3 and v4: |
| 80 | + |
| 81 | + ```js |
| 82 | + // Tailwind CSS v3 |
| 83 | + /** @type {import('tailwindcss').Config} */ |
| 84 | + export default { |
| 85 | + prefix: "tw-", |
| 86 | + // ... rest of your config |
| 87 | + }; |
| 88 | + |
| 89 | + // Tailwind CSS v4 |
| 90 | + @import "tailwindcss" prefix(tw); |
| 91 | + ``` |
| 92 | + |
| 93 | +- Prefix configuration in `.flowbite-react/config.json`: |
| 94 | + |
| 95 | + ```json |
| 96 | + { |
| 97 | + "$schema": "https://unpkg.com/flowbite-react/schema.json", |
| 98 | + "prefix": "tw" |
| 99 | + } |
| 100 | + ``` |
| 101 | + |
| 102 | +- ThemeConfig component support for prefix configuration: |
| 103 | + |
| 104 | + ```tsx |
| 105 | + import { ThemeConfig } from "flowbite-react"; |
| 106 | + |
| 107 | + export default function App() { |
| 108 | + return ( |
| 109 | + <> |
| 110 | + <ThemeConfig prefix="tw" /> |
| 111 | + {/* ... */} |
| 112 | + </> |
| 113 | + ); |
| 114 | + } |
| 115 | + ``` |
| 116 | + |
| 117 | +Learn more about prefix configuration in our [prefix documentation](https://flowbite-react.com/docs/customize/prefix). |
| 118 | + |
| 119 | +### 3. CLI Enhancements |
| 120 | + |
| 121 | +- New project initialization command: |
| 122 | + |
| 123 | + ```bash |
| 124 | + npx flowbite-react@latest init |
| 125 | + ``` |
| 126 | + |
| 127 | +Learn more about CLI features in our [CLI documentation](https://flowbite-react.com/docs/getting-started/cli). |
| 128 | + |
| 129 | +### 4. Tailwind CSS Version Compatibility |
| 130 | + |
| 131 | +- Automatic version detection between Tailwind CSS v3 and v4 |
| 132 | +- Seamless support for both versions without manual configuration |
| 133 | +- Improved class merging and prefix handling for each version |
| 134 | + |
| 135 | +### 5. Configuration System |
| 136 | + |
| 137 | +- New `.flowbite-react/config.json` for centralized configuration (automatically generated): |
| 138 | + |
| 139 | + ```json |
| 140 | + { |
| 141 | + "$schema": "https://unpkg.com/flowbite-react/schema.json", |
| 142 | + "components": [], |
| 143 | + "dark": true, |
| 144 | + "path": "src/components", |
| 145 | + "prefix": "", |
| 146 | + "rsc": true, |
| 147 | + "tsx": true |
| 148 | + } |
| 149 | + ``` |
| 150 | + |
| 151 | +Learn more about configuration options in our [config documentation](https://flowbite-react.com/docs/customize/config). |
| 152 | + |
| 153 | +### 6. Custom Components |
| 154 | + |
| 155 | +#### Component Creation |
| 156 | + |
| 157 | +- Added CLI command for component generation: |
| 158 | + |
| 159 | + ```bash |
| 160 | + npx flowbite-react@latest create my-component |
| 161 | + ``` |
| 162 | + |
| 163 | +- Automatic setup based on `.flowbite-react/config.json` configuration: |
| 164 | + - Component path location |
| 165 | + - React Server Components support |
| 166 | + - TypeScript/JavaScript selection |
| 167 | + |
| 168 | +#### Theme System Integration |
| 169 | + |
| 170 | +- Full theming system support for custom components: |
| 171 | + - Global theme inheritance |
| 172 | + - Component-level overrides |
| 173 | + - Provider-level props |
| 174 | + - Theme clearing and applying |
| 175 | + - Type safety with TypeScript |
| 176 | + |
| 177 | +## Technical Improvements |
| 178 | + |
| 179 | +### Build System |
| 180 | + |
| 181 | +- Improved bundler compatibility and performance |
| 182 | +- Added support for tree-shaking |
| 183 | +- Enhanced TypeScript configuration |
| 184 | +- Optimized production builds |
| 185 | + |
| 186 | +### Component Updates |
| 187 | + |
| 188 | +- Improved component primitives |
| 189 | +- Enhanced type safety across components |
| 190 | +- Added extensive test coverage |
| 191 | + |
| 192 | +### Developer Experience |
| 193 | + |
| 194 | +- Added comprehensive TypeScript types |
| 195 | +- Improved VSCode integration |
| 196 | +- Enhanced debugging capabilities |
| 197 | + |
| 198 | +### Exports and Package Structure |
| 199 | + |
| 200 | +- All components, hooks, and utilities are now exported from the root package |
| 201 | +- Every internal part and primitive is exposed for advanced customization |
| 202 | +- Improved module resolution with better tree-shaking support |
| 203 | +- Direct access to component parts without compound components |
| 204 | +- TypeScript types for all exports are available |
| 205 | + |
| 206 | +## Breaking Changes |
| 207 | + |
| 208 | +### Component Changes |
| 209 | + |
| 210 | +- Deprecated compound components in favor of simpler component primitives: |
| 211 | + |
| 212 | + ```tsx |
| 213 | + // Before - Compound components |
| 214 | + <Accordion> |
| 215 | + <Accordion.Panel> |
| 216 | + <Accordion.Title>Title 1</Accordion.Title> |
| 217 | + <Accordion.Content>Content 1</Accordion.Content> |
| 218 | + </Accordion.Panel> |
| 219 | + </Accordion> |
| 220 | + |
| 221 | + // After - Simple primitives |
| 222 | + <AccordionRoot> |
| 223 | + <AccordionItem> |
| 224 | + <AccordionTitle>Title 1</AccordionTitle> |
| 225 | + <AccordionContent>Content 1</AccordionContent> |
| 226 | + </AccordionItem> |
| 227 | + </AccordionRoot> |
| 228 | + ``` |
| 229 | + |
| 230 | +- Removed `helperText` prop from all form components in favor of using the `HelperText` component directly |
| 231 | +- Deprecated `href` prop in `Badge` component |
| 232 | +- Updated `Button` component to use new color system: |
| 233 | + - Added `default` and `alternative` colors |
| 234 | + - Changed default color from `blue` to `default` |
| 235 | + - Modified hover states to use primary colors |
| 236 | + - Moved theme size styles from inner span to root button element |
| 237 | + |
| 238 | +### Theme System |
| 239 | + |
| 240 | +- Changed theme application behavior: |
| 241 | + - Enhanced `ThemeProvider` with deep merging of themes |
| 242 | + - Added support for granular theme resets using `clearTheme` |
| 243 | + - Improved theme resolution with better performance |
| 244 | + - Updated color schemes to use primary colors consistently |
| 245 | +- Modified component color schemes: |
| 246 | + - Updated default colors to use `primary` instead of specific colors (e.g., `cyan`) |
| 247 | + - Standardized color naming across components |
| 248 | + - Enhanced color inheritance and theme customization |
| 249 | + |
| 250 | +Learn more about theming in our [theme documentation](https://flowbite-react.com/docs/customize/theme). |
| 251 | + |
| 252 | +### Package and Build System |
| 253 | + |
| 254 | +- Switched package type to `module` |
| 255 | +- Added new entry points for better module resolution |
| 256 | +- Removed `react-icons` dependency in favor of custom icon components |
| 257 | +- Added support for [Yarn Plug'n'Play (PnP)](https://yarnpkg.com/features/pnp): |
| 258 | + |
| 259 | +### API Changes |
| 260 | + |
| 261 | +- Deprecated `<Flowbite>` component in favor of `ThemeProvider` |
| 262 | +- Removed `getStore()` export and limited to finite actions and getters |
| 263 | +- Added `forwardRef` to almost all components |
| 264 | +- Removed redundant `Flowbite` prefix from type names |
| 265 | + |
| 266 | +## Migration Guide |
| 267 | + |
| 268 | +1. Update to the latest version: |
| 269 | + |
| 270 | + ```bash |
| 271 | + npm install flowbite-react@latest |
| 272 | + ``` |
| 273 | + |
| 274 | +2. Initialize the new engine: |
| 275 | + |
| 276 | + ```bash |
| 277 | + npx flowbite-react@latest init |
| 278 | + ``` |
| 279 | + |
| 280 | + This will: |
| 281 | + |
| 282 | + - Set up the `.flowbite-react` directory |
| 283 | + - Configure your bundler |
| 284 | + - Update VSCode settings |
| 285 | + - Create necessary configuration files |
| 286 | + |
| 287 | +3. Clean up your Tailwind configuration: |
| 288 | + |
| 289 | + ```diff |
| 290 | + - import flowbite from 'flowbite-react/tailwind'; |
| 291 | + |
| 292 | + /** @type {import('tailwindcss').Config} */ |
| 293 | + export default { |
| 294 | + content: [ |
| 295 | + - flowbite.content(), |
| 296 | + + // The init command will add the correct content paths |
| 297 | + ], |
| 298 | + plugins: [ |
| 299 | + - flowbite.plugin(), |
| 300 | + + // The init command will add the correct plugins |
| 301 | + ], |
| 302 | + } |
| 303 | + ``` |
| 304 | + |
| 305 | +## Fixed Issues and Pull Requests |
| 306 | + |
| 307 | +### Resolved Issues |
| 308 | + |
| 309 | +- [#339](https://github.com/themesberg/flowbite-react/issues/339) |
| 310 | +- [#1197](https://github.com/themesberg/flowbite-react/issues/1197) |
| 311 | +- [#1286](https://github.com/themesberg/flowbite-react/issues/1286) |
| 312 | +- [#1389](https://github.com/themesberg/flowbite-react/issues/1389) |
| 313 | +- [#1447](https://github.com/themesberg/flowbite-react/issues/1447) |
| 314 | +- [#1454](https://github.com/themesberg/flowbite-react/issues/1454) |
| 315 | +- [#1473](https://github.com/themesberg/flowbite-react/issues/1473) |
| 316 | +- [#1489](https://github.com/themesberg/flowbite-react/issues/1489) |
| 317 | +- [#1508](https://github.com/themesberg/flowbite-react/issues/1508) |
| 318 | +- [#1523](https://github.com/themesberg/flowbite-react/issues/1523) |
| 319 | + |
| 320 | +### Resolved Pull Requests |
| 321 | + |
| 322 | +- [#1155](https://github.com/themesberg/flowbite-react/pull/1155) |
| 323 | + |
| 324 | +## Technical Requirements |
| 325 | + |
| 326 | +- Node.js 16+ |
| 327 | +- Tailwind CSS v3 or v4 |
| 328 | +- React 18+ |
| 329 | + |
| 330 | +For detailed documentation on all new features and integrations, visit: |
| 331 | + |
| 332 | +## Core Documentation |
| 333 | + |
| 334 | +- [Quickstart (Updated)](https://flowbite-react.com/docs/getting-started/quickstart) |
| 335 | +- [CLI (Updated)](https://flowbite-react.com/docs/getting-started/cli) |
| 336 | +- [Compatibility (New)](https://flowbite-react.com/docs/getting-started/compatibility) |
| 337 | +- [Editor Setup (Updated)](https://flowbite-react.com/docs/getting-started/editor-setup) |
| 338 | +- [Server Components (Updated)](https://flowbite-react.com/docs/getting-started/server-components) |
| 339 | + |
| 340 | +## Customization |
| 341 | + |
| 342 | +- [Theme (Updated)](https://flowbite-react.com/docs/customize/theme) |
| 343 | +- [Config (New)](https://flowbite-react.com/docs/customize/config) |
| 344 | +- [Prefix (New)](https://flowbite-react.com/docs/customize/prefix) |
| 345 | +- [Colors (New)](https://flowbite-react.com/docs/customize/colors) |
| 346 | +- [Custom Components (New)](https://flowbite-react.com/docs/customize/custom-components) |
0 commit comments