Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mishieck/ink-titled-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ink-titled-box

A component for using titled borders in Ink. It is an extension of the Box component of Ink.

Installation

The library uses the peer dependencies react and ink.

NPM

npm i @mishieck/ink-titled-box

Bun

bun add @mishieck/ink-titled-box

Features

Border Styles

Border Styles

Note: Arrow borders do not work with the titles.

Positions

Positions

Title Styles

Title Styles

Colors

Image

Props

borderStyle

This is the same as that in Ink, except it is required.

titles

An array of titles for the border.

titleStyles

The styles of titles as shown in Title Styles. Without styles, the titles have a transparent background and padded on both ends with a space. The value is an object with the following properties:

  • start: the character before the title.
  • end: the character after the title.

The library provides some title styles through the export titleStyles. You can create your own in addition to those. You can use the provided styles as follows:

import React from "react";
import {TitledBox, titleStyles} from "@mishieck/ink-titled-box";

const Demo: React.FC = () => (
    <TitledBox
        borderStyle="single"
        titles={["Demo"]}
        titleStyles={titleStyles.rectangle}
    />
);

Note: apart from titleStyles.rectangle, all other styles use Nerd Fonts. So, if you do not have Nerd Fonts installed, you will not get the expected results.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published