# Customize the views

## Using Tailwind Front-end Components in Your Ruby on Rails Application

In our Ruby on Rails application, we utilize Tailwind CSS for styling, complemented by components from the DaisyUI library. You will find the custom Tailwind components organized in the `views > components` folder.

### Using DaisyUI Components

<figure><img src="/files/EVKN3vEOrQsOjOc7L6ne" alt=""><figcaption></figcaption></figure>

We use DaisyUI to enhance our Tailwind components with pre-designed UI elements. DaisyUI provides various components that you can easily integrate into your application, allowing for rapid and responsive UI design.

You can explore the full range of DaisyUI components on their website: [DaisyUI](https://daisyui.com/).

Feel free to check out their library and incorporate any components that fit your design needs into our application!

***

### Rendering Tailwind Components included by default in Lightning Rails

To include Tailwind components in your views, simply use the `render` ERB tag. This makes it super easy to integrate components throughout your application.

How easy is it? The entire LightningRails home page is built with just 7 lines of code (already included in the boilerplate) 🤯:

<pre class="language-css"><code class="lang-css"><strong># views/home.html.erb
</strong><strong>&#x3C;%= render "components/hero" %>
</strong>&#x3C;%= render "components/featured_on" %>
&#x3C;%= render "components/text_image" %>
&#x3C;%= render "components/feature_tabs" %>
&#x3C;%= render "components/price_cards" %>
&#x3C;%= render "components/faq" %>
&#x3C;%= render "components/cta_horizontal" %>
</code></pre>

#### (Optional) - Passing Instance Variables to Components

If you have instance variables in your controller and want to pass them to a button component, here's how you can do it:

1. **Pass any variable to the component:**

   When rendering the button component in your view:

   ```erb
   <%= render 'components/button', locals: { label: @button_label, color: @button_color } %>
   ```
2. **Access the variables in your component:**

   In your `_button.html.erb` partial, you can now use the `label` and `color` variables to customize the button:

   ```erb
   <button class="<%= color %> text-white font-bold py-2 px-4 rounded">
     <%= label %>
   </button>
   ```

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lightningrails.com/getting-started/customize-the-views.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
