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

nativescript-radio-dialog

v1.0.4

Published

A NativeScript plugin that provides radio button dialogs.

Readme

NativeScript Radio Dialog

npm npm

A NativeScript plugin that provides radio button dialogs for both Android and iOS. This plugin fills the gap where standard NativeScript dialogs don't support radio button lists, offering a native implementation.

Features

  • 📱 Cross-platform: Works on both Android and iOS
  • 🎨 Material Design: Automatic Material Design 2/3 support based on your app theme
  • 🔧 Easy to use: Simple Promise-based API
  • Lightweight: No external dependencies beyond NativeScript core
  • 🎯 TypeScript: Full TypeScript support with type definitions

Installation

npm install nativescript-radio-dialog

Material Design Support

The plugin automatically detects your app's Material Design theme and uses the appropriate dialog style:

  • Material Design 3: Used when your app has Theme.Material3.* theme on Android 12+
  • Material Design 2: Used as fallback for older Android versions or Theme.MaterialComponents.* themes
  • iOS: Uses native UIAlertController with action sheet style

Usage

TypeScript/JavaScript

import { RadioDialog } from "nativescript-radio-dialog";

// Basic usage
const result = await RadioDialog.show({
    title: "Select Language",
    items: ["English", "Русский", "Español", "Français"]
});

if (!result.cancelled) {
    console.log(`Selected: ${result.selectedItem} (index: ${result.selectedIndex})`);
}

// With preselected option
const result = await RadioDialog.show({
    title: "Update Frequency",
    items: ["Daily", "Weekly", "Monthly", "Never"],
    selectedIndex: 1, // Pre-select "Weekly"
    cancelButtonText: "Skip"
});

// With custom button labels
const result = await RadioDialog.show({
    title: "Save Options",
    items: ["Save to Cloud", "Save Locally", "Don't Save"],
    selectedIndex: 0,
    okButtonText: "Apply",
    cancelButtonText: "Skip"
});

Vue.js

<template>
    <StackLayout>
        <Button @tap="showLanguageDialog" text="Select Language" />
        <Label :text="selectedLanguage" />
    </StackLayout>
</template>

<script>
import { RadioDialog } from "nativescript-radio-dialog";

export default {
    data() {
        return {
            selectedLanguage: "No language selected"
        };
    },
    methods: {
        async showLanguageDialog() {
            try {
                const result = await RadioDialog.show({
                    title: "Select Language",
                    items: ["English", "Русский", "Español", "Français"],
                    cancelButtonText: "Cancel"
                });

                if (!result.cancelled) {
                    this.selectedLanguage = `Selected: ${result.selectedItem}`;
                }
            } catch (error) {
                console.error("Dialog error:", error);
            }
        }
    }
};
</script>

API

RadioDialog.show(options)

Shows a radio button dialog and returns a Promise that resolves with the user's selection.

Options

| Property | Type | Default | Description | | --- | --- | --- | --- | | title | string | Required | Dialog title text | | items | string[] | Required | Array of options to display | | selectedIndex | number | -1 | Index of initially selected item (0-based) | | okButtonText | string | "OK" | Text for the OK button (Android only) | | cancelButtonText | string | "Cancel" | Text for the cancel button |

Returns: Promise<RadioDialogResult>

| Property | Type | Description | | --- | --- | --- | | selectedIndex | number | Index of selected item (0-based), or -1 if cancelled | | selectedItem | string | Text of selected item, or empty string if cancelled | | cancelled | boolean | true if dialog was cancelled, false if item was selected |

Screenshots

Android Material You

iOS

Platform Differences

Android

  • Uses Material Design dialogs with radio buttons
  • Shows both OK and Cancel buttons
  • Supports Material Design 2 and 3 themes

iOS

  • Uses native UIAlertController with action sheet style
  • Each item is a separate action button
  • Only shows Cancel button (items are directly selectable)
  • Automatically handles iPad positioning

Requirements

  • NativeScript 8.0+
  • Android API 21+ (Android 5.0+)
  • iOS 12.0+

License

Apache License Version 2.0