Files
hinode/content/en/blog/bootstrap.md
2022-12-31 06:55:52 +01:00

20 KiB

author, title, date, description, tags, thumbnail, photoCredits, photoSource
author title date description tags thumbnail photoCredits photoSource
Mark Dumay Bootstrap Components 2022-12-26 Overview of available Bootstrap components
bootstrap
img/boots.jpg <a href="https://unsplash.com/@nate_dumlao">Nathan Dumlao</a> <a href="https://unsplash.com/photos/QLPWQvHvmII">Unsplash</a>

Bootstrap provides several out-of-the-box UI components. The Hinode theme uses several of these components for rendering, such as the navigation menu and scrollspy. A few components are made available as Hugo shortcode, see [Custom Shortcodes]({{< ref "custom-shortcodes" >}} "Custom Shortcodes"). You can embed the Bootstrap components themselves too. The paragraphs below demonstrate the available UI components.

Accordion

Accordion Item #1

This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.

Accordion Item #2

This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.

Accordion Item #3

This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.

Alerts

The alert is available as [custom shortcode]({{< ref "custom-shortcodes#alert" >}} "custom shortcode"). The following shortcode displays a simple alert.

{{< alert color="danger" >}} A simple danger alert—check it out! {{< /alert >}}

Badge

Headings

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New

Buttons

The badge for a button is available via a [custom shortcode]({{< ref "custom-shortcodes#button" >}} "custom shortcode").

Breadcrumb

The breadcrumb is available as [custom shortcode]({{< ref "custom-shortcodes#breadcrumb" >}} "custom shortcode"). The following example displays a breadcrumb for the current page.

{{< breadcrumb >}}

Buttons

The button is available as [custom shortcode]({{< ref "custom-shortcodes#button" >}} "custom shortcode"). The following example displays a tooltip for a dark button with a badge.

{{< button color="dark" tooltip="Click on the inbox to view your unread messages" href="#" badge="99+" >}} Inbox {{< /button >}}

Button Group

The button group is available as [custom shortcode]({{< ref "custom-shortcodes#button-group" >}} "custom shortcode"). The following example displays a group of three buttons.

{{< button-group aria-label="Basic example" >}} {{< button color="primary" href="#" >}}Left{{< /button >}} {{< button color="primary" href="#" >}}Middle{{< /button >}} {{< button color="primary" href="#" >}}Right{{< /button >}} {{< /button-group >}}

Card

The card is available as [custom shortcode]({{< ref "custom-shortcodes#card" >}} "custom shortcode"). The following example displays a card that links to the [Rich Content]({{< ref "rich-content" >}} "Rich Content") page.

{{< card path="rich-content" class="w-50" layout="rich" >}}

The carousel is available as [custom shortcode]({{< ref "custom-shortcodes#carousel" >}} "custom shortcode"). The following example displays a centered carousel with three slides, 16x9 aspect ratio, and a relative width of 67% on large screens.

{{< carousel ratio="16x9" class="col-sm-12 col-lg-8 mx-auto" >}} {{< img src="img/coffee.jpg" caption="slide 1" >}} {{< img src="img/phone.jpg" caption="slide 2" >}} {{< img src="img/dunes.jpg" caption="slide 3" >}} {{< /carousel >}}

Close button

Collapse

Link with href Button with data-bs-target

Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.

Dropdowns

Single button

Split button

List group

Modal

Launch demo modal

Navbar

Navs & tabs

Offcanvas

Link with href Button with data-bs-target
Offcanvas
Some text as placeholder. In real life you can have the elements you have chosen. Like, text, images, lists, etc.

Pagination

Placeholders

Popovers

Click to toggle popover

Progress

Scrollspy

Navbar

Navbar

First heading

...

Second heading

...

Third heading

...

Fourth heading

...

Fifth heading

...

Nested nav

Item 1

...

Item 1-1

...

Item 1-2

...

Item 2

...

Item 3

...

Item 3-1

...

Item 3-2

...

List group

Item 1

...

Item 2

...

Item 3

...

Item 4

...

Simple anchors

Item 1

...

Item 2

...

Item 3

...

Item 4

...

Item 5

...

Spinners

The spinner is available as [custom shortcode]({{< ref "custom-shortcodes#spinner" >}} "custom shortcode"). The following example displays a centered spinner:

{{< spinner color="info" class="text-center" >}} Loading... {{< /spinner >}}

Toasts

Show live toast

Bootstrap 11 mins ago
Hello, world! This is a toast message.

Tooltips

The tooltip is available as [custom shortcode]({{< ref "custom-shortcodes#tooltip" >}} "custom shortcode"). The following example displays a tooltip for a colored hyperlink:

{{< tooltip color="warning" title="Tooltip" href="#" >}} Tooltip demonstration {{< /tooltip >}}