npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tcom-obov

v0.0.4

Published

ease apply css on text with Tailwind and Typescript

Readme

text_component

ease apply css on text with Tailwind and Typescript

사용예시

import text from "./text-alltags";

<text.p variant="large / exBold / accent" value="문자 입력" />

위와 같이 입력시 다음과 같이 출력됩니다.

<p class="text-base font-extrabold text-rose-400">테일윈드 사용 시</p>

사용방법 - 주요 코드는 text-alltag.tsx에 모두 포함되어있습니다.

  • text는 object로써 React에서 지원하는 모든 element를 호출할 수 있습니다
  • variant 값에 "(크기) / (굵기) / (색상)" 의 순서로 넣어 tailwind를(class를) 적용합니다.
  • variant 에 값을 입력하는 경우 typescript 덕분에 입력할수 있는 모든 경우의 수를 바로 확인할 수 있습니다.
  • variant 는 디폴트 값을 지정할 수 있고 다음과 같이 작성할 수 있습니다.
<t.div variant="- / * / " value="디폴트 값을 활용하면 더 깔끔합니다" />
<t.div variant=" /  / " value="모두 빈문자열로 지정한 경우" />

초기 세팅하기

  1. text-alltag.tsx 의 vaiants 값과 SEPERATOR 필요에 따라 수정하여 세팅할 수 있습니다.

const SEPERATOR = " / ";
const variants = {
  [SIZE]: {
    [DEFAULT]: ["base", "-"],
    exSmall: "text-xs",
    small: "text-sm",
    base: "text-base",
    large: "text-lg",
    exLarge: "text-xl",
  },
  [WEIGHT]: {
    [DEFAULT]: ["medium", "*"],
    light: "font-light",
    normal: "font-normal",
    medium: "font-medium",
    semibold: "font-semibold",
    bold: "font-bold",
    exBold: "font-extrabold",
  },
  [COLOR]: {
    [DEFAULT]: ["primary", ""],
    primary: "text-emerald-600",
    secondary: "text-amber-400",
    accent: "text-rose-400",
  },
} as const;

  1. 필요한 곳에 호출하여 사용하면 됩니다.
import t from "./text-alltags";

    <t.p variant="- / exBold / accent" value="타입스크립트 사용 시" />
    <t.div variant="large / * / " value="좀더 직관적으로" />
    <t.article
      variant="base / medium / secondary"
      value="class를 전달하는 방법입니다."
    />
    <t.span
      variant="exLarge / * / "
      className="text-justify"
      value="타입스크립트 덕분에 자동완성 되는 부분이 인상적이었고"
    />
    <t.a
      variant="large / bold / "
      value="명확하게 텍스트를 꾸미는 로직임을 알 수 있어 좋았습니다."
    />