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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ng-zi/extensions-button-toggle

v0.0.1

Published

Angular Material Extensions for button-toggle

Downloads

8

Readme

MtxButtonToggle Component Overview

The MtxButtonToggle component is a wrapper around Angular Material's button toggle component. It provides enhanced features and additional customization options, ensuring seamless integration and usage within your Angular applications.

Basic Button-Toggles

Button toggles can be used to group related options. A button toggle consists of a single button toggle and can be grouped together in a button toggle group.

<mtx-button-toggle-group name="fontStyle" aria-label="Font Style">
  <mtx-button-toggle value="bold">Bold</mtx-button-toggle>
  <mtx-button-toggle value="italic">Italic</mtx-button-toggle>
  <mtx-button-toggle value="underline">Underline</mtx-button-toggle>
</mtx-button-toggle-group>

Exclusive Selection

When appearance is set to standard, the button toggles within the group behave as radio buttons, where only one button can be selected at a time.

<mtx-button-toggle-group name="alignment" aria-label="Text alignment" appearance="standard">
  <mtx-button-toggle value="left">Left</mtx-button-toggle>
  <mtx-button-toggle value="center">Center</mtx-button-toggle>
  <mtx-button-toggle value="right">Right</mtx-button-toggle>
  <mtx-button-toggle value="justify">Justify</mtx-button-toggle>
</mtx-button-toggle-group>

Multiple Selection

When appearance is set to legacy, the button toggles behave as checkboxes, allowing multiple selections.

<mtx-button-toggle-group name="textFormatting" aria-label="Text formatting" appearance="legacy">
  <mtx-button-toggle value="bold">Bold</mtx-button-toggle>
  <mtx-button-toggle value="italic">Italic</mtx-button-toggle>
  <mtx-button-toggle value="underline">Underline</mtx-button-toggle>
</mtx-button-toggle-group>

Vertical Button Toggle Group

Button toggle groups can be displayed vertically by setting the vertical input to true.

<mtx-button-toggle-group vertical>
  <mtx-button-toggle value="left">Left</mtx-button-toggle>
  <mtx-button-toggle value="center">Center</mtx-button-toggle>
  <mtx-button-toggle value="right">Right</mtx-button-toggle>
  <mtx-button-toggle value="justify">Justify</mtx-button-toggle>
</mtx-button-toggle-group>

Appearance Variants

The MtxButtonToggle component supports various appearance options to match different design requirements. The appearance input can be set to legacy or standard.

<mtx-button-toggle-group appearance="legacy">
  <mtx-button-toggle value="bold">Bold</mtx-button-toggle>
  <mtx-button-toggle value="italic">Italic</mtx-button-toggle>
  <mtx-button-toggle value="underline">Underline</mtx-button-toggle>
</mtx-button-toggle-group>

Customizing the Theme

You can customize the theme of the MtxButtonToggle component by using Angular Material’s theming capabilities. This allows you to create a consistent look and feel across your application.

@use '@angular/material' as mat;

.mt-button-toggle-theme {
  @include mat.button-toggle-theme($primary);
}

Additional Features

  • Custom Icons: Use custom icons for toggle buttons.
  • ARIA Support: Enhanced accessibility features with ARIA roles and attributes.
  • Animations: Smooth transitions and animations for better user experience.
  • Responsive: Fully responsive design that adapts to various screen sizes.

For more details on configuration options and advanced usage, refer to the API documentation.