Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Feedback

TwIcon

TwIcon is a Blazor icon component for Bootstrap Icons. Pass an Icon enum value, style it with Tailwind classes, or add OnClick to make an icon button.

Last updated 10 October 2026

Icons

Use TwIcon to display any Bootstrap icon.
RAZOR
<div class="d-flex gap-3 align-items-center mb-3">
    <TwIcon Icon="Icon.Heart_Fill" Class="text-4xl size-12 p-1 text-red-600 hover:text-red-400" OnClick="LikeIconClicked" AriaLabel="Like" />
    <TwIcon Icon="Icon.Star_Fill" Class="text-4xl p-1 text-blue-600" />
    <TwIcon Icon="Icon.Check_Circle_Fill" Class="text-2xl p-1 text-pink-600" />
</div>

Icon buttons

Passing OnClick wraps the icon in a circular button. It gets a hover state-layer and a press "pulse" automatically, even without a Color set.
RAZOR
<div class="d-flex gap-3 align-items-center mb-3">
    <TwIcon Icon="Icon.Trash" Class="text-xl p-2" OnClick="DeleteIconClicked" AriaLabel="Delete" />
    <TwIcon Icon="Icon.Github" Class="text-xl p-2 text-purple-600" OnClick="GithubIconClicked" AriaLabel="View on GitHub" />
    <TwIcon Icon="Icon.Heart_Fill" Class="text-xl p-2 text-red-600" OnClick="LikeIconClicked" AriaLabel="Like" />
    <TwIcon Icon="Icon.Share" Class="text-xl p-2" OnClick="ShareIconClicked" AriaLabel="Share" />
</div>

Icon button tooltips

Set Tooltip on an icon button to explain what it does on hover and keyboard focus. The tooltip is a role="tooltip" element linked via aria-describedby, and can be dismissed with Escape. Keep providing an AriaLabel, since the tooltip only supplements the button's accessible name. It has no effect on a non-interactive icon (no OnClick), which can't receive focus.
Delete item Share with others
RAZOR
<div class="d-flex gap-3 align-items-center mb-3">
    <TwIcon Icon="Icon.Trash" Class="text-xl p-2" OnClick="DeleteIconClicked" AriaLabel="Delete" Tooltip="Delete item" />
    <TwIcon Icon="Icon.Share" Class="text-xl p-2" OnClick="ShareIconClicked" AriaLabel="Share" Tooltip="Share with others" />
</div>

Icon size

You can control icon sizes using Tailwind CSS font size classes or passing in your owm.
RAZOR
<div class="d-flex gap-3 align-items-center mb-3">
    <TwIcon Icon="Icon.Gear_Fill" Class="text-xs" />
    <TwIcon Icon="Icon.Gear_Fill" Class="text-lg" />
    <TwIcon Icon="Icon.Gear_Fill" Class="text-xl" />
    <TwIcon Icon="Icon.Gear_Fill" Class="text-2xl" />
    <TwIcon Icon="Icon.Gear_Fill" Class="text-3xl" />
    <TwIcon Icon="Icon.Gear_Fill" Class="text-4xl" />
</div>

Icon library

Browse through all available Bootstrap icons. Click on any icon to copy its enum value.
Zero_Circle
Zero_Circle_Fill
Zero_Square
Zero_Square_Fill
One_Circle
One_Circle_Fill
One_Square
One_Square_Fill
One_Two_Three
Two_Circle
Two_Circle_Fill
Two_Square
Two_Square_Fill
Three_Circle
Three_Circle_Fill
Three_Square
Three_Square_Fill
Four_Circle
Four_Circle_Fill
Four_Square
Four_Square_Fill
Five_Circle
Five_Circle_Fill
Five_Square
Five_Square_Fill
Six_Circle
Six_Circle_Fill
Six_Square
Six_Square_Fill
Seven_Circle
Seven_Circle_Fill
Seven_Square
Seven_Square_Fill
Eight_Circle
Eight_Circle_Fill
Eight_Square
Eight_Square_Fill
Nine_Circle
Nine_Circle_Fill
Nine_Square

Keyboard navigation

An icon is decorative and is not a Tab stop. An icon with OnClick is a button.
Key What it does
Tab Moves focus to a clickable icon.
Enter or Space Activates a clickable icon.
Escape Hides the icon's tooltip, if it has one.

On this page

  • Icons
  • Icon buttons
  • Icon button tooltips
  • Icon size
  • Icon library
  • Keyboard navigation
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload