New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@christiankaindl/lyts

Package Overview
Dependencies
Maintainers
0
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@christiankaindl/lyts

Layout primitives for React

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47
increased by11.9%
Maintainers
0
Weekly downloads
 
Created
Source

LYTS

Abstract illustrations depicting the available layout components

Layout primitives for React.

LYTS

Layout primitives to build any kind of layout with useful props like bleed, asChild and xAlign/yAlign.

  • Like Lego – Compose primitives to create complex layouts
  • Tiny bundle – Only 445 Bytes total (source)
  • Unstyled – Bring your own styling solution—Tailwind, CSS Modules, you name it
  • Layout props – Simple & productive API

⚛️ Components API · 📚 Guides · 📖 Examples

To get started, import a base component and compose them together—Stack, Row, Clamp, Columns, Grid—happy layout building!

[!NOTE] Version 2.0 introduced support for React 19, and migrated away from using forwardRef(). This means v2.0 may not work as intended when using with React 18 or earlier. If you want to pass refs to LYTS components and use React 18 or lower, consider using v1.2.0 instead, which has full support.

Usage

Layout components can be composed until you achieve your desired layout. For example, The following <CenterCard> component renders a card with a max-width of 400px, centers it and uses a Stack to get consistent spacing:

image

const CenterCard: FunctionComponent = function () {
  return (
    // A card with clamped 400px and centered
    <Clamp clamp='400px'>
      <Stack gap={0.75} className='card'>
        <h3>Card title</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
      </Stack>
    </Clamp>
  )
}

Check out the Examples page for a comprehensive collection of layouts and how to build them with LYTS.

A real-world example using LYTS is this documentation site, which makes extensive use of all components. Check out the code here!

Support & help

If you get stuck, reach out to @christiankaindl on Twitter. In case of bugs, open an issue on GitHub.

Local Development

npm install
npm run dev

FAQs

Package last updated on 18 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc