📜  Tabicon - Html (1)

📅  最后修改于: 2023-12-03 15:20:27.038000             🧑  作者: Mango

Tabicon - Html

Tabicon is a lightweight and easy-to-use HTML and CSS library for creating custom tabs and navigation bars. It supports both horizontal and vertical tabs, as well as responsive designs that adapt to different screen sizes.

Getting started

To get started with Tabicon, you need to include the library in your HTML document and add the necessary CSS classes to your markup. Here's an example:

<!-- Include Tabicon library -->
<link rel="stylesheet" href="https://unpkg.com/tabicon@1.0.0/dist/tabicon.min.css">

<!-- Set up Tabs -->
<div class="tabicon horizontal">
  <div class="tabicon-item"><a href="#tab1">Tab 1</a></div>
  <div class="tabicon-item active"><a href="#tab2">Tab 2</a></div>
  <div class="tabicon-item"><a href="#tab3">Tab 3</a></div>
</div>

<!-- Set up Tab Content -->
<div class="tabicon-content">
  <div class="tabicon-pane" id="tab1">
    <h2>Tab 1 content</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
  </div>
  <div class="tabicon-pane active" id="tab2">
    <h2>Tab 2 content</h2>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
  </div>
  <div class="tabicon-pane" id="tab3">
    <h2>Tab 3 content</h2>
    <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
  </div>
</div>

In this example, we've set up three horizontal tabs with different content for each tab. The "active" class is added to the second tab to indicate which tab is currently selected.

Customization

Tabicon has a number of CSS classes and variables that you can use to customize the look and behavior of your tabs. Here are some examples:

Variables
  • --tabicon-font: sets the font for the tabs and content panes
  • --tabicon-color: sets the color for the tabs and content panes
  • --tabicon-bg-color: sets the background color for the tabs and content panes
  • --tabicon-active-color: sets the color for the active tab and content pane
  • --tabicon-active-bg-color: sets the background color for the active tab and content pane
  • --tabicon-border-radius: sets the border radius for the tabs and content panes
Horizontal tabs
  • .tabicon.horizontal: sets up the tabs to be displayed in a horizontal layout
  • .tabicon-item: defines a single tab item
  • .tabicon-item.active: defines the active tab item
  • .tabicon-content: contains the content panes for the tabs
  • .tabicon-pane: defines a single content pane
Vertical tabs
  • .tabicon.vertical: sets up the tabs to be displayed in a vertical layout
  • .tabicon-item: defines a single tab item
  • .tabicon-item.active: defines the active tab item
  • .tabicon-content: contains the content panes for the tabs
  • .tabicon-pane: defines a single content pane
Conclusion

Tabicon is a versatile and easy-to-use HTML and CSS library for creating custom tabs and navigation bars. With its lightweight design and responsive capabilities, you can create beautiful and functional tabs for any project.