tailwind_flutter library

Tailwind CSS design tokens and utility-first styling API for Flutter.

Provides a complete set of Tailwind CSS v4 design tokens (colors, spacing, typography, shadows, radii, opacity, breakpoints) as type-safe Dart constants, plus composable widget extensions and a style composition system.

Classes

TwBreakpoints
Tailwind CSS v4 responsive breakpoints as static const double pixel values.
TwBreakpointTheme
Theme extension providing the Tailwind CSS responsive breakpoints.
TwColors
The complete Tailwind CSS v4 color palette.
TwColorTheme
Theme extension providing the full Tailwind CSS color palette.
TwDarkVariant
Variant that matches Brightness.dark.
TwFontSizes
Tailwind CSS font size scale.
TwFontWeights
Tailwind CSS font weight constants.
TwLetterSpacing
Tailwind CSS letter-spacing scale as em multipliers.
TwLightVariant
Variant that matches Brightness.light.
TwLineHeights
Tailwind CSS line-height scale as ratios.
TwOpacity
Tailwind CSS v4 opacity scale as static const double values.
TwOpacityTheme
Theme extension providing the Tailwind CSS opacity scale.
TwRadii
Tailwind CSS border radius scale.
TwRadiusTheme
Theme extension providing the Tailwind CSS border radius scale.
TwShadows
Tailwind CSS box shadow presets.
TwShadowTheme
Theme extension providing the Tailwind CSS box shadow presets.
TwSpacing
The complete Tailwind CSS spacing scale.
TwSpacingTheme
Theme extension providing the Tailwind CSS spacing scale.
TwStyle
An immutable set of visual properties for composable styling.
TwTheme
A convenience widget that injects all Tailwind CSS ThemeExtension instances into the widget tree via Theme.
TwThemeData
Aggregates all 7 Tailwind CSS ThemeExtension instances and provides convenient factory constructors for light and dark presets.
TwTypeScale
Material Design type roles mapped to Tailwind CSS font size tokens.
TwTypographyTheme
Theme extension providing Tailwind CSS typography tokens.
TwVariant
A condition that determines when a variant style applies.

Enums

TwTypeVariant
Size variant for semantic type roles.

Extension Types

TwColorFamily
A Tailwind CSS v4 color family containing 11 shade variants.
TwFontRole
A semantic font role grouping three size variants of TwFontSize.
TwFontSize
A Tailwind CSS font size token pairing a font size with its default line-height ratio.
TwRadius
A Tailwind CSS border radius token that can be used transparently as a double value and also provides convenience BorderRadius getters.
TwSpace
A Tailwind CSS spacing value that implements double for transparent use in any Flutter API expecting a numeric value.

Extensions

TwTextExtensions on Text
Tailwind-style text styling extensions on Text.
TwThemeContext on BuildContext
Provides tw and twMaybe accessors on BuildContext for convenient access to the nearest TwThemeData.
TwWidgetExtensions on Widget
Tailwind-style chaining extensions on Widget.

Constants

tailwindFlutterVersion → const String
The current version of the tailwind_flutter package.