Heroes are used to provide a large, eye-catching introduction to a page or site. They are responsive by default and will stack on smaller screens.

Basic Hero

The basic hero is a simple hero with a title and a subtitle.

Preview

Hello, World!

Welcome to the world of LocoMotion.

Get Started
Code
= daisy_hero(css: "bg-base-200 text-center") do
  - # Heroes display their children in a flex column by default
  %div
    %h1.text-5xl.font-bold
      Hello, World!
    %p.my-6
      Welcome to the world of LocoMotion.
    = daisy_button(css: "btn btn-primary", title: "Get Started", href: "/")

Heroes with Images

You can add an image to the hero by making it the first or last child.

You can also change the layout of the hero by passing a content_wrapper_css to make it responsive or add other styling.

Preview
Beautiful Landscape

Hello, World!

Welcome to the world of LocoMotion.

Get Started

Hello, World!

Welcome to the world of LocoMotion.

Get Started
Beautiful Landscape
Code
= daisy_hero(css: "bg-base-200", content_wrapper_css: "flex-col md:flex-row") do
  %img.h-40.rounded{ src: image_path('landscapes/mountain-river.jpg'), alt: "Beautiful Landscape" }

  %div
    %h1.text-5xl.font-bold
      Hello, World!
    %p.my-6
      Welcome to the world of LocoMotion.
    = daisy_button(css: "btn btn-primary", title: "Get Started", href: "/")

= daisy_hero(css: "bg-base-200", content_wrapper_css: "flex-col md:flex-row") do
  %div
    %h1.text-5xl.font-bold
      Hello, World!
    %p.my-6
      Welcome to the world of LocoMotion.
    = daisy_button(css: "btn btn-primary", title: "Get Started", href: "/")

  %img.h-40.rounded{ src: image_path('landscapes/mountain-river.jpg'), alt: "Beautiful Landscape" }

Hero with Overlay

The Hero component provides an overlay slot allowing you to add a semi-transparent background to the hero and apply other effects (such as a blur).

Preview

Hello, World!

Welcome to the world of LocoMotion.

Get Started
Code
- image = image_path("landscapes/mountain-river.jpg")
= daisy_hero(css: "bg-base-200 min-h-96", html: { style: "background-image: url('#{image}')" }) do |hero|
  - hero.with_overlay(css: "bg-black bg-opacity-50 backdrop-blur")

  %div.text-white
    %h1.text-5xl.font-bold
      Hello, World!
    %p.my-6
      Welcome to the world of LocoMotion.
    = daisy_button(css: "btn btn-accent", title: "Get Started", href: "/")
Made with by Profoundry .
Copyright © 2023-2025 Profoundry LLC.
All rights reserved.