Components
CloseButton
Compact control for closing dialogs, modals, or dismissing content — aligned with @heroui/react and close-button.css (tertiary · sm · icon-only).
Usage
Default dismiss control; wraps RiseButton with tertiary · sm · icon-only defaults.
RiseCloseButton(
onPressed: () {},
)With custom icon
Replace the default Icons.close via child, or tune iconProps for size/color.
Wrap(
spacing: 16,
runSpacing: 16,
children: [
RiseCloseButton(
onPressed: () {},
child: Icon(Icons.close, size: 20),
),
RiseCloseButton(
onPressed: () {},
child: Icon(Icons.highlight_off_outlined, size: 20),
),
],
)Interactive
Same component wired to local state.
class CloseDemo extends StatefulWidget {
@override
State<CloseDemo> createState() => _CloseDemoState();
}
class _CloseDemoState extends State<CloseDemo> {
int clicks = 0;
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Text('Clicked: $clicks times'),
SizedBox(height: 16),
RiseCloseButton(
onPressed: () => setState(() => clicks++),
),
],
);
}
}