@hixme-ui/phone

hixme-ui phone component for linking and formatting phone numbers.

Usage no npm install needed!

<script type="module">
  import hixmeUiPhone from 'https://cdn.skypack.dev/@hixme-ui/phone';
</script>

README

Phone

npm i --save @hixme-ui/phone

View it live

Phone extends the @hixme/text to provide phone formatting and linking

Usage

import Phone from '@hixme-ui/phone'

<Phone number='8881234567' />
// ouputs phone link as
// <a href="tel:8881234567">(888) 123 - 4567</a>

Phone.format

Phone has a format function it uses to display the phone format, and is accessible if needed outside of the JSX

import Phone from '@hixme-ui/phone'

Phone.format('8881234567')
// outputs string (888) 123 - 4567