Lunchbox 🍱 example sitePress Tab and use the keyboard to move around.

Hello ( ´ ω ` )ノ゙ Thanks for stopping by and showing interest! This site serves as a showcase for all the components available in the Lunchbox library, each displayed with configurable attributes and brief explanations. This very text is wrapped inside the <Header/> component, which is part of the "Page Components" group we'll talk about later. Typically, the <Header/> is followed by the <Navigation/> component. You can even configure the <Header/> to fill most of the viewport's height by setting the boolean attribute "banner" to true.

Page components

In addition to <Header/>, we have <Navigation/>, <Main/>, and <Footer/> components. These are designed to be used no more than once per page, ensuring your layouts stay clean and semantic. They're standardized extensions of the proper HTML elements you'd typically use. For maintaining grid and responsive visual consistency throughout your page, you can use the <Layout/> and <Module/> components multiple times as needed.

Panel

The <Panel/> component provides a contrasting background against the page's main background, creating areas that stand out or are separated from the main content. This background serves as the base aesthetic contrast for many components like <Header/>, <Footer/>, <Navigation/>, <Code/>, <Button/>, <Card/>, and <Menu/>. It's arguably one of the most important components in the library.

This is a panel component.

Button

Our <Button/> component is a straightforward extension of the standard HTML button element. It offers various "type" options like "default", "disabled", "error", "panel", and "transparent" to suit different use cases. You can also adjust the "padding" with options like "default", "large", and "compact" to fit your design needs.

Press space key to ativate

Input

The <Input/> component extends the HTML input element but wraps it inside a label element. This approach eliminates the need to manage "for" and "id" attributes while maintaining accessibility. You can control its width using the "max width" attribute, allowing it to stretch to the container's maximum width if needed. If there's an issue, just fill the "error" attribute with your error message, and the input will automatically update its style to reflect the error state. The "placeholder" attribute works just as you'd expect, and adding "required" will display a little "*" next to the label text.

Textarea

The <Textarea/> component follows the same principles as <Input/> but extends the textarea HTML element. It inherits all the convenient features like automatic error styling and accessible labeling.

Select

The <Select/> component also mirrors <Input/> but extends the select HTML element. You can conveniently add possible values using the "options" attribute, which accepts an array of strings or option elements. This saves you from manually looping over option elements. Need a placeholder? It works just like in standard HTML—adding an "option value='' selected hidden" element to the top of the list.

Fieldset

Our <Fieldset/> component extends the fieldset HTML element for grouping related inputs. It includes a "legend" attribute where you can provide a string that adds a legend element for proper semantics. You can nest <Input/> components inside, especially those of type "checkbox" or "radio", all connected using the same "name" attribute to group them logically.

Text

The <Text/> component is as simple as it gets—extending the span element to handle text without imposing any specific semantic HTML elements like h1 or p. This gives you the flexibility to style your text as you see fit. It comes with a "type" attribute where you can choose from "display", "title", "heading", "subheading", "paragraph", or "small". The larger types ("display", "title", "heading") feature a contrasting, colorful tone and a serif typeface (defaults to LibreCaslonText). The smaller types ("subheading", "paragraph", "small") use more neutral colors like whitish or blackish and a sans-serif typeface (defaults to Figtree).

The <Link/> component extends the anchor element but is designed specifically for textual links composed using the <Text/> component. It enforces underline and hover styles to ensure consistency. However, if you need more flexibility or functionality, you're absolutely free to use the standard HTML anchor tag. It's straightforward and sometimes that's all you need!

Kbd

Our <Kbd/> component extends the kbd HTML element, adding standard styles to represent keyboard input. It uses a monospace font (defaults to Fira Code) and defaults to the "small" text type, differentiating it from the <Code/> component.

Code

Similarly, the <Code/> component extends the code HTML element for displaying inline code snippets. It also uses a monospace font (defaults to Fira Code) but defaults to the "paragraph" text type, making it suitable for larger blocks of code.

Text Text Text Text Text Text

Pattern

The <Pattern/> component is a unique take on using CSS gradients. Instead of typical gradient effects, it creates solid, repeating patterns that can add interesting edges to your elements. Inspired by designs found online, we've developed three patterns: "cloud", "zigzag", and "wave".

Linkmap

Our <Linkmap/> component makes it easy to generate a table of contents by using the "links" attribute. It leverages the <Link/> component we discussed earlier to create a navigable list.

Loader

The <Loader/> component is an animated loading icon to indicate that something is in progress. It uses the <IconLoader/> component and adds smooth animation to keep users informed while they wait.

Loaded!

Card

The <Card/> component helps you create image-related panels. By adding an image URL, you can display a stylized card that's perfect for showcasing posts, events, or any blocks of information. It comes with added styles like rounded edges and padding to make your content look neat and inviting.

Standard Test ImageActual test image of jelly beans from the USC-SIPI image database.
Lenna (or Lena)Image of Lena Forsén used in many image processing experiments.

Separator

Our <Separator/> component is a simple extension of the hr HTML element. It includes the library's styles for border color and margins to ensure it fits seamlessly with the rest of your design.


Markdown

The <Markdown/> component automatically interprets and renders markdown content, using styles consistent with the rest of the elements in the library. It employs semantic elements, so when you use "#" in your markdown, it appropriately turns into an "h1" element.

Design Revolution

Introduction

In the world of web development, creating websites that are both highly configurable and accessible is paramount. Embracing good HTML practices ensures a foundation that is robust and scalable. This manifesto champions a theme-centered approach, leveraging CSS variables while deliberately avoiding the use of frameworks like Tailwind CSS.

Read more about our design principles

Section 1

A responsive design ethos is essential in the modern digital landscape. By prioritizing dark mode as the default, we acknowledge the growing preference for user interfaces that are easy on the eyes, particularly in low-light environments. Moreover, this approach not only enhances usability but also aligns with energy-saving practices.

The power of CSS variables cannot be understated. They offer a centralized way to manage and customize styles across an entire project, ensuring consistency and ease of maintenance. For instance, defining a primary color as --primary-color: #3498db; allows for effortless updates and theme adjustments without redundant code changes.

Section 2

Avoiding Tailwind CSS is a conscious decision to promote clarity and simplicity.

Section 2.1

While Tailwind offers utility classes, our philosophy prioritizes semantic HTML and meaningful class names that improve readability and maintainability. Inline-code blocks like class="btn-primary" are intuitive and convey purpose without the overhead of memorizing countless utility classes.

Section 2.2

Ultimately, a dark-mode-first design approach combined with a commitment to good HTML practices and CSS variables ensures a scalable, maintainable, and user-friendly web experience. Embrace the revolution and craft websites that stand the test of time.

The <Menu/> component is made up of a clickable element and a floating submenu that contains additional options. It's designed as an island component, handling the interactions for opening and closing, as well as showing and hiding the floating submenu beneath the clickable element. It can be used with the <MenuItem/> component for a standarized list.

Future Components?

I knew you'd be here, inspecting the page or something, welcome to the spoilers for the following updates of Lunchbox. This section of content is almost unedited, it's like a section of notes and thoughts mainly aimed to myself in the future or anyone curious enough to read it through a little piece of CSS obstacle. If the latter is the case, again, thank you very much for your interest in this bizarre project.

Autocomplete

This component is almost done, I need to rethink a few things about it because it remained in a earlier stage of development. I think that the menu functionality can be abstracted from the <Menu/> island no problem. Also, this is the time (not only at the end, but even after the end, that late hahaha) to update it to the new standard component build functions, (forward() and such). This would be the last component/island to have the previous standard and the forward function could be removed entirely.

This task must be done with outmost urgency and should carry with it a few fixes. I'm thinking that finishing this component implies an upgrade to the <MenuItem/> component that sees rather empty at the moment.

ContentEditable

This is my next idea for a component. This is an interesting one because I feel it is rarely used, but when it is, I wish it would be turned into an understandable and predictable component so I wouldn't think about it ever again. What is the initial case use I see for this components? They're two, actually. To give more pizazz to an input interaction, like adding styles to the text being entered or even to alter the height of the input component solely depending on the text content's height. Secondly, the obvious feature of in-place editing that aren't directly rich text.

Table and Pagination

This is an interesting component, it will be the second to be based on other people's work. The first is the <Markdown/> component that takes from the deno-gfm project. I haven't been able to convince them to add a feature that allows to insert custom css classes to rendered markdown elements, but oh well, I'm digressing. This components will be using the project DataTable from the developer atmelino. I believe that it has the required features to be implemented and I'd love to involve other members of the Deno Fresh community,

This component is still blurry in my mind. I don't know if I should make it so that it can automatically take /the/route/from/the/url and render itself accordingly. Additionally a feature could be to only display as links the steps that are available pages. But I still don't know I I leave it manual and call it a day.