Component Library
M2 standardized UI components for MTG Deckbuilder
Button Variants
{{ button('Primary Button', variant='primary') }}
{{ button('Secondary Button', variant='secondary') }}
{{ button('Ghost Button', variant='ghost') }}
{{ button('Danger Button', variant='danger') }}
Button Sizes
{{ button('Small', size='sm') }}
{{ button('Medium (Default)', size='md') }}
{{ button('Large', size='lg') }}
Icon Buttons
{{ icon_button('×', aria_label='Close', size='sm') }}
{{ icon_button('☰', aria_label='Menu', size='md') }}
{{ icon_button('⚙', aria_label='Settings', size='lg') }}
Tag Buttons
{{ tag_button('Ramp') }}
{{ tag_button('Removal', selected=True) }}
{{ tag_button('Card Draw', removable=True, on_remove='alert("Tag removed")') }}
{{ tag_button('Counterspells') }}
Button Groups
{{ button_group([ {'text': 'Back', 'variant': 'secondary'}, {'text': 'Cancel', 'variant': 'ghost'}, {'text': 'Save', 'variant': 'primary', 'type': 'submit'} ], alignment='right') }}Link Buttons
{{ button('Go Home', href='/', variant='ghost') }}
{{ button('Build Deck', href='/build', variant='primary') }}
{% endcall %}
{% call panel(title='Modals', padding='lg') %}
{% call panel(title='Form Components', padding='lg') %}
{% endcall %}
{% call panel(title='Card Display Components', padding='lg') %}
{% call panel(title='Panel Components', padding='lg') %}
{% endblock %}
Click buttons to see modal examples
{{ button('Simple Modal', onclick='showSimpleModalExample()') }}
{{ button('Confirm Dialog', onclick='showConfirmExample()') }}
{{ button('Alert (Success)', onclick='showAlertExample("success")') }}
{{ button('Alert (Error)', onclick='showAlertExample("error")') }}
Modal Sizes
{{ button('Small (480px)', onclick='showSizedModal("sm")') }}
{{ button('Medium (620px)', onclick='showSizedModal("md")') }}
{{ button('Large (720px)', onclick='showSizedModal("lg")') }}
{{ button('XLarge (960px)', onclick='showSizedModal("xl")') }}
{% endcall %}
Card Thumbnail Sizes
{{ card_thumb('Sol Ring', size='small', show_name=True) }}
{{ card_thumb('Lightning Bolt', size='medium', show_name=True) }}
{{ card_thumb('Rampant Growth', size='large', show_name=True) }}
Dual-Faced Card with Flip Button
{{ card_thumb('Delver of Secrets // Insectile Aberration', size='large', layout='transform', show_flip=True, show_name=True) }}
Card Grid
Hover over cards to see popup (desktop) or tap (mobile)
{{ card_grid([ {'name': 'Sol Ring', 'role': 'ramp', 'tags': ['Ramp', 'Artifact']}, {'name': 'Lightning Bolt', 'role': 'removal', 'tags': ['Removal', 'Instant']}, {'name': 'Rampant Growth', 'role': 'ramp', 'tags': ['Ramp', 'Sorcery']}, {'name': 'Counterspell', 'role': 'control', 'tags': ['Counterspell', 'Instant']}, {'name': 'Swords to Plowshares', 'role': 'removal', 'tags': ['Removal', 'Instant']}, {'name': 'Birds of Paradise', 'role': 'ramp', 'tags': ['Ramp', 'Creature']} ], size='medium', columns=3) }} {% endcall %}Panel Variants
{{ simple_panel(title='Default Panel', content='This is a default panel with standard background.
', variant='default') }} {{ simple_panel(title='Alt Panel', content='This is an alternate panel with lighter background.
', variant='alt') }} {{ simple_panel(title='Dark Panel', content='This is a dark panel with darker background.
', variant='dark') }} {{ simple_panel(title='Bordered Panel', content='This is a bordered panel with no background.
', variant='bordered') }}Info Panels
{{ info_panel( icon='ℹ️', title='Information', content='This is an informational message.', type='info' ) }} {{ info_panel( icon='✅', title='Success', content='Operation completed successfully!', type='success' ) }} {{ info_panel( icon='⚠️', title='Warning', content='Please review your selections.', type='warning' ) }} {{ info_panel( icon='❌', title='Error', content='An error occurred. Please try again.', type='error', action_text='Retry', action_onclick='alert("Retrying...")' ) }}Stat Panels
{{ stat_panel('Total Cards', value=100) }}
{{ stat_panel('Avg MV', value='3.2', sublabel='Mana Value', variant='primary') }}
{{ stat_panel('Lands', value=37, variant='success') }}
{{ stat_panel('Budget', value='$125', variant='warning') }}
Collapsible Panel
{% call collapsible_panel(title='Advanced Options', expanded=False) %}These are advanced settings that are hidden by default.
- Option 1: Enable feature X
- Option 2: Adjust threshold Y
- Option 3: Configure behavior Z
Empty State
{{ empty_state_panel( icon='📋', title='No Decks Found', message='You haven\'t created any decks yet. Start building your first deck!', action_text='Build Deck', action_href='/build' ) }}Loading State
{{ loading_panel(message='Building deck...', spinner=True) }} {% endcall %}
{{ button('Back to Top', href='#', variant='ghost', onclick='window.scrollTo({top:0,behavior:"smooth"}); return false;') }}