xiaohongshu
xiaohongshu
Full skill instructions
Cinder is a data table component for Phoenix LiveView with Ash Framework integration.
<Cinder.Table.table resource={MyApp.User} actor={@current_user}>
<:col :let={user} field="name" filter sort>{user.name}</:col>
<:col :let={user} field="email" filter>{user.email}</:col>
<:col :let={user} field="created_at" sort>{user.created_at}</:col>
</Cinder.Table.table>
<!-- Resource -->
<Cinder.Table.table resource={MyApp.User} actor={@current_user}>
<!-- Pre-configured query -->
<Cinder.Table.table query={MyApp.User |> Ash.Query.filter(active: true)} actor={@current_user}>
<!-- Custom read action -->
<Cinder.Table.table query={Ash.Query.for_read(MyApp.User, :active_users)} actor={@current_user}>
field="name"field="department.name"field="settings__country" (double underscore)field - required for data columnsfilter - enables filtering (auto-detects type)sort - enables sortingsearch - includes field in table searchlabel="Custom" - override column header<!-- Auto-detected -->
<:col field="status" filter>Status</:col>
<!-- Specify type -->
<:col field="status" filter={:select}>Status</:col>
<!-- Unified syntax with options -->
<:col field="status" filter={[type: :select, prompt: "All Statuses", options: @statuses]}>Status</:col>
<:col field="price" filter={[type: :number_range, min: 0, max: 1000]}>Price</:col>
<:col field="tags" filter={[type: :multi_select, match_mode: :any, prompt: "Select tags"]}>Tags</:col>
<:col field="active" filter={[type: :boolean, labels: %{true: "Active", false: "Inactive"}]}>Status</:col>
<!-- Custom filter function -->
<:col field="name" filter={[type: :text, fn: &custom_name_filter/2]}>Name</:col>
<!-- Basic sorting -->
<:col field="name" sort>Name</:col>
<!-- Custom sort cycles -->
<:col field="priority" sort={[cycle: [nil, :desc_nils_first, :asc_nils_last]]}>Priority</:col>
<:col :let={user} label="Actions">
<.link patch={~p"/users/#{user.id}/edit"}>Edit</.link>
<button phx-click="delete" phx-value-id={user.id}>Delete</button>
</:col>
Filter on fields without displaying them as columns:
<Cinder.Table.table resource={MyApp.User} actor={@current_user}>
<:col :let={user} field="name" filter sort>{user.name}</:col>
<!-- Filter-only fields -->
<:filter field="department.name" type="select" options={@departments} />
<:filter field="active" type="boolean" />
<:filter field="created_at" type="date_range" />
</Cinder.Table.table>
resource={Resource} or query={query} - data sourceactor={@current_user} - required for Ash authorizationtheme="modern" - built-in themes: default, modern, retro, futuristic, dark, daisy_ui, flowbite, compact, pastelpage_size={25} - fixed page sizepage_size={[default: 25, options: [10, 25, 50, 100]]} - configurable with dropdownurl_state={@url_state} - enable URL synchronizationrow_click={fn item -> JS.navigate(~p"/path/#{item.id}") end} - row interactivityquery_opts={[timeout: 30_000, authorize?: false]} - Ash query optionsscope={scope} - Ash authorization scopetenant={tenant} - multi-tenancy support<!-- Auto-enabled when columns have search attribute -->
<:col :let={user} field="name" search filter>{user.name}</:col>
<!-- Custom search configuration -->
<Cinder.Table.table search={[label: "Search users", placeholder: "Enter name or email"]}>
<!-- Explicitly disable search -->
<Cinder.Table.table search={false}>
empty_message="No records found" - custom empty stateloading_message="Loading..." - custom loading stateshow_filters={true} - show/hide filter UIfilters_label="🔍 Filters" - customize filter section labelAuto-detected from Ash resource attributes:
:text) - string/atom fields → contains/starts_with/ends_with
operator, case_sensitive, placeholder:select) - enum attributes → dropdown
options, prompt:boolean) - boolean fields → true/false radio buttons
labels map with true/false keys:date_range) - date/datetime fields → date pickers
include_time, format:number_range) - numeric fields → min/max inputs
min, max, step:multi_select) - array fields → tag-based selection
options, prompt, match_mode (:any/:all):multi_checkboxes) - array fields → checkbox interface
options, match_mode (:any/:all):checkbox) - single checkbox for "show only X"
value, labelEnable bookmarkable, shareable table states:
defmodule MyAppWeb.UsersLive do
use MyAppWeb, :live_view
use Cinder.Table.UrlSync
def handle_params(params, uri, socket) do
socket = Cinder.Table.UrlSync.handle_params(params, uri, socket)
{:noreply, socket}
end
def render(assigns) do
~H"""
<Cinder.Table.table resource={MyApp.User} actor={@current_user} url_state={@url_state}>
<:col :let={user} field="name" filter sort>{user.name}</:col>
</Cinder.Table.table>
"""
end
end
# config/config.exs
config :cinder, :filters, [
slider: MyApp.Filters.Slider,
color_picker: MyApp.Filters.ColorPicker
]
# application.ex
def start(_type, _args) do
Cinder.setup() # Registers configured filters
# ... rest of startup
end
defmodule MyApp.Filters.Slider do
@behaviour Cinder.Filter
use Phoenix.Component
@impl true
def render(column, current_value, theme, assigns) do
# Return HEEx template
end
@impl true
def process(raw_value, column) do
# Transform form input to filter value struct
%{type: :slider, value: raw_value, operator: :between}
end
@impl true
def validate(filter_value), do: true
@impl true
def default_options, do: [min: 0, max: 100, step: 1]
@impl true
def empty?(value), do: is_nil(value)
@impl true
def build_query(query, field, filter_value) do
# Build Ash query filter
end
end
<:col field="price" filter={[type: :slider, min: 0, max: 1000, step: 10]}>Price</:col>
Refresh table data while preserving state:
import Cinder.Table.Refresh
def handle_event("delete", %{"id" => id}, socket) do
# ... delete logic ...
{:noreply, refresh_table(socket, "table-id")}
end
# Refresh multiple tables
{:noreply, refresh_tables(socket, ["table1", "table2"])}
# config/config.exs
config :cinder, default_theme: "modern"
<Cinder.Table.table theme="dark" resource={MyApp.User}>
"default" - minimal styling"modern" - clean, contemporary design"dark" - dark mode styling"retro" - vintage appearance"futuristic" - sci-fi inspired"daisy_ui" - DaisyUI component styles"flowbite" - Flowbite design system"compact" - dense layout"pastel" - soft color paletteUse render_async for data-dependent assertions:
{:ok, view, html} = live(conn, ~p"/users")
assert html =~ "Loading..."
assert render_async(view) =~ "John Doe"
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience