From c17a283fb4d4db551b14bf058848412f20833016 Mon Sep 17 00:00:00 2001 From: Kuldeepdev Date: Fri, 29 Mar 2024 16:23:36 +0530 Subject: [PATCH] docs: Update text-zoom README.md Adding Example for TextZoom plugin. --- text-zoom/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/text-zoom/README.md b/text-zoom/README.md index cfba1875f..9dc7669ff 100644 --- a/text-zoom/README.md +++ b/text-zoom/README.md @@ -19,6 +19,26 @@ npm install @capacitor/text-zoom npx cap sync ``` +## Example + +```typescript +import { TextZoom } from '@capacitor/text-zoom'; + +const getTextZoom = async () => { + const { value } = await TextZoom.get(); + console.log(`Current zoom level is ${value}`); +}; + +const getPreferredTextZoom = async () => { + const { value } = await TextZoom.getPreferred(); + console.log(`Preferred zoom level is ${value}`); +}; + +const setTextZoom = async () => { + await TextZoom.set({ value: 1.3 }); +}; +``` + ## API