The personal finance app for everyone (by everyone)
Ruby
Design system
Consult app/assets/tailwind/sure-design-system.css
and existing DS::* components before building UI.
- Use functional tokens:
text-primary,bg-container,border-primary,bg-warning/10,text-destructive. Do not use raw palette classes or hex literals. - Reach for
DS::Alert,DS::Button,DS::Disclosure,DS::Dialog,DS::Menuand other existing primitives before making an alert, badge, button, disclosure, dialog or input shape. - If a diff contains the same hand-built shape at least twice and no DS equivalent exists, propose a new DS primitive before introducing the second copy.
- Use the
iconhelper fromApplicationHelper, neverlucide_icondirectly. Raw SVG belongs only inside DS primitives. - Use scale tokens rather than arbitrary pixel values when a scale token fits.
- Do not add new styles to
sure-design-system.cssorapplication.csswithout explicit permission. - Reviewers escalate DS reuse and repeated-shape violations to close/rewrite. Token, icon/SVG, localization and scale violations are request-changes.
For templates, Hotwire, Stimulus and localization guidance, see the UI guide.
Tables
Render data tables with DS::Table, not
hand-written <table> markup. Declare each column once; the table renders the
header and every cell with the standard padding, header style and row rules.
<%= render DS::Table.new(rows: payments) do |table| %>
<% table.with_column(t(".date")) { |payment| l(payment.date, format: :long) } %>
<% table.with_column(t(".amount"), numeric: true, class: "privacy-sensitive") { |payment| format_money(payment.amount) } %>
<% end %>
numeric: truefor figures (right-aligned, tabular digits, no wrapping);align: :rightfor other right-hand columns such as actions.inset: truewhen the table sits inside a card; its header row takes the frame's container-inset. On the page background the table is a card of its own.sticky_header: truefor long tables.- Pass
label:whenever the table can scroll, including sideways on a narrow screen, so keyboard users can reach it. - A column block must output markup or return a String; call
to_son numbers.
Form actions
A form with one action ends in f.submit,
which renders a full-width primary DS::Button on a styled_form_with form. A
form with Cancel and a primary action ends in a right-aligned pair of
natural-width buttons at the default size: Cancel, then the primary action. The
variant carries the hierarchy, not the width.
<div class="flex justify-end gap-2">
<%= render DS::Button.new(text: t(".cancel"), variant: :secondary, data: { action: "DS--dialog#close" }) %>
<%= render DS::Button.new(text: t(".save"), type: :submit) %>
</div>
- Cancel takes
variant: :secondaryor:ghost. A Cancel that leaves the page is aDS::Linkwith the same variant. - A destructive action takes
variant: :destructivein the primary's place.f.submitis always primary, so a destructive single action is aDS::Buttonwithfull_width: trueandtype: :submit. - Don't put
f.submitin a pair: it is always full width and ignoresclass:. Render the primary withtype: :submit, as above. - Keep the default size.
size: :smtext buttons are 28px tall, and the 44px coarse-pointer target only applies to icon-only buttons. - When a
DS::Dialog's buttons don't submit a form,dialog.with_actionrenders this row;cancel_action: truemakes a button close the dialog. - Examples:
budget_categories/_move_dialog,goals/consume, the currencies dialog insettings/preferences/show, the bulk edit drawer and the filter popover. - Amount inputs stay left-aligned, as
money_fieldrenders them. Right alignment with tabular digits is for displayed figures (numeric: trueabove) and for inputs inside a column of them, such as the budget grid.