Search documentation of pain

# PainWeb.Components.CardExamples (pain v0.1.0)

Copy Markdown

Example using the `rounded` property and slots.

## Properties

- id :string, required: true - Both the DOM ID and the ID to uniquely identify a LiveView. An `:id` is automatically generated when rendering root LiveViews but it is a required option when rendering a child LiveView.

- container :tuple - An optional tuple for the HTML tag and DOM attributes to be used for the LiveView container. For example: `{:li, style: "color: blue;"}`. By default it uses the module definition container.

- session :map - A map of binary keys with extra session data to be serialized and sent to the client. All session data currently in the connection is automatically available in LiveViews. You can use this option to provide extra data. Remember all session data is serialized and sent to the client, so you should always keep the data in the session to a minimum. For example, instead of storing a User struct, you should store the "user_id" and load the User when the LiveView mounts.

- sticky :boolean - An optional flag to maintain the LiveView across live redirects, even if it is nested within another LiveView. If you are rendering the sticky view within your live layout, make sure that the sticky view itself does not use the same layout. You can do so by returning `{:ok, socket, layout: false}` from mount.

## Summary

### Functions

card_with_footer_example(assigns)

An example of a card with footer.

mount(params, session, socket)

Callback implementation for `Phoenix.LiveView.mount/3`.

render(arg)

Callback implementation for `Phoenix.LiveView.render/1`.

rounded_card_example(assigns)

An example of a rounded card.

## Functions

# card_with_footer_example(assigns)

An example of a card with footer.

# mount(params, session, socket)

Callback implementation for `Phoenix.LiveView.mount/3`.

# render(arg)

Callback implementation for `Phoenix.LiveView.render/1`.

# rounded_card_example(assigns)

An example of a rounded card.