SectionOptions

The SectionOptions type defines the configuration for a section within a card component in ts-better-console. Sections are used for the title and footer areas of a card, providing both content and optional styling.

Type Definition

The SectionOptions type includes the following properties:

  • content: The text shown in the section.
  • align: Optional alignment — "left", "center", or "right".
  • style: An optional StyleOptions object for color, background, and text styles.
type SectionOptions = {
  content: string;
  align?: Alignment;
  style?: StyleOptions;
}

Usage

You can use SectionOptions when defining the title or footer of a card:

import { Card } from "ts-better-console";

new Card("Card body content", {
title: {
content: "Welcome",
style: {
color: "cyan",
styles: ["bold"],
},
},
footer: {
content: "Press any key to continue",
style: { color: "gray", styles: ["italic"] },
},
});

Want to support this project?

If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.

Want to contribute to this project?

Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!