class ExpressTemplates::Components::Configurable

Configurable components support configuration options supplied to the builder method. Supported options must be declared. All other options are passed along and converted to html attributes.

Example:

“`ruby

class Pane < ExpressTemplates::Components::Configurable

has_option :title, "Displayed in the title area", required: true
has_option :status, "Displayed in the status area"

end

# Usage:

pane(title: “People”, status: “#{people.count} people”)

“`ruby

Options specified as required must be supplied.

Default values may be supplied for options with a default: keyword. The value may be a proc. Useful for instances where you want a different value every time.

Options may be passed as html attributes with attribute: true